Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-04-2010, 11:40 AM   #31
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Manichean View Post
So you're importing with lastname, firstname(s) in the authors field and want firstname(s) lastname? That's easy: Do a search in the authors field for
Code:
([^,]*),\s(.*?)
and replace with
Code:
\2 \1
You don't want the non-greedy version in the last group of the search.

use the greedy version:
Code:
([^,]*),\s(.*)
and
Code:
\2 \1
Starson17 is offline   Reply With Quote
Old 10-04-2010, 11:57 AM   #32
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,860
Karma: 7036057
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by dkritso109 View Post
i'm hoping that there's a way to retain series name and number in the {Title} field without having to search and replace each and everytime i input a series.
I hesitate to jump in here, because you seem to be trying to do things that almost no one understands. That said ...

There is no trigger that will automatically update the title field when you change the series. In fact, the series information probably shouldn't be in the 'real' title field, but that is an argument that I don't want to get in to.

What you should do is create a custom composite field (field made from other fields). Call it mytitle or some such. For the template, use
Code:
{series}{series_index:0>2s| | - }{title}
You will have a column showing you the title in the format you want. If you wish, use mytitle in save templates and in plugboards to modify the title in the book when you send it out of the library.

Create as many of these fields as you want. For example, create one for myauthor that puts the series there. Create one that is myeverything that includes series, title, author, isbn, and publication date. Lots of possibilities.
chaley is offline   Reply With Quote
Advert
Old 10-04-2010, 12:00 PM   #33
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by dkritso109 View Post
Search and Replace:

Alan Dean Foster {Author(s)} ---------> Foster, Alan Dean {Author(s)}

i just tried your search and replace code and it does nothing.
I suggested two search & replace operations, the one going from firstname lastname to lastname, firstname and the other vice versa. Which one did you try?

Quote:
i can totally see the search and replace function as an extremely powerful tool, but i'm kinda scared to use it. back up time!!! also i'm hoping that there's a way to retain series name and number in the {Title} field without having to search and replace each and everytime i input a series.
I don't see a way to do that. And as for being scared: Go read the tutorial that was linked. If you understand regular epxressions, there's no reason to be afraid of the feature. (Still, a backup would be a Good Thing.)
Manichean is offline   Reply With Quote
Old 10-04-2010, 12:07 PM   #34
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Manichean View Post
@kacir: Yes, but that still requires the search & replace- pass after importing. I don't think there's currently a way to avoid that.
I agree - there is no way to avoid this. You must do either: 1) S&R, or 2) import once with the swap option on for books that need it and once with it off for the rest.
Starson17 is offline   Reply With Quote
Old 10-04-2010, 01:20 PM   #35
dkritso109
Enthusiast
dkritso109 began at the beginning.
 
Posts: 43
Karma: 10
Join Date: Jun 2010
Device: Kindle 3
ok, about the series being displayed in the title, i have lost the real reason of why it is not displayed in the title. so it can successfully download the metadata. i have spent so many hours doing it one by one copying and pasting that i missed that the series info is displayed in the series field. i literally spent all of yesterday inputing hundreds of books, using the regex you guys gave me i was able to input a few hundred already today with minimal effort and no copy and pasting. i am leaving the titles without the series info in them and my life has become so much easier. i am just going to make a new column as you suggested.

i am so happy right now, and everything is sailing smoothly.

there is just one thing i have noticed but really i don't care because it is a kind of small issue:
when i input a book that has a series name but no series number the series name appears in the {Title} field, for example:

Foster, Alan Dean - Aliens Vs Predator - War
turns into:
Aliens Vs Predator - War {Title} Foster, Alan Dean {Author(s)}

there are very few books with a series name without a number so i am not the least bit worried about this.

you guys absolutely rock! thanks for the help!

i am going to donate a dollar to calibre on each of your names

p.s.s i must add that alan foster is not actually the author of the book war that i used as an example.

Last edited by dkritso109; 10-04-2010 at 01:28 PM.
dkritso109 is offline   Reply With Quote
Advert
Old 10-04-2010, 01:53 PM   #36
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by dkritso109 View Post
there is just one thing i have noticed but really i don't care because it is a kind of small issue:
when i input a book that has a series name but no series number the series name appears in the {Title} field, for example:

Foster, Alan Dean - Aliens Vs Predator - War
turns into:
Aliens Vs Predator - War {Title} Foster, Alan Dean {Author(s)}

there are very few books with a series name without a number so i am not the least bit worried about this.
If you post the regexp you use, someone can explain this to you. There are several regexps around that do not suffer from this problem. Most regexps identify the series by number and you are using one of those. Since it doesn't bother you, there's no reason to change.
Starson17 is offline   Reply With Quote
Old 10-04-2010, 04:59 PM   #37
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
If you're using the regexp kacir posted earlier, try this modification:
Code:
(?P<author>[^-]+)( - \[?(?P<series>[^-]+)(\[| )*(?P<series_index>[0-9]+)?\]?)? - (?P<title>.+)
That should make the series index optional if series is present.
And go read that tutorial I keep talking about! It's why it's there.
Manichean is offline   Reply With Quote
Old 10-04-2010, 06:24 PM   #38
dkritso109
Enthusiast
dkritso109 began at the beginning.
 
Posts: 43
Karma: 10
Join Date: Jun 2010
Device: Kindle 3
nice work, that definately fixed the un-numbered series so it doesn't end up in the title, but there's a weird side effect. in the {Series} field when i input this for example:

Bunch, Chris - Legion 01 - The Last Legion

this is what comes up in the {Series} field:

Legion 01 [1]

when i input this:

Bunch, Chris - Legion 02 - Firemask

this comes up in the {Series} field:

Legion 02 [1]

notice that the numbers are outside the brackets and the 1 appears in all of them in the brackets. this happens to all of them in the series.

this is what it looks like with the prior regexp:

Legion [1]
Legion [2]

other than that it's perfect. it is a little annoying, but it's purely cosmetic. whereas earlier when i input:

Bunch, Chris - Legion - Firemask

this is what pops up in the {Title} field:

Legion - Firemask {Title}

notice that i left the number out this time? this keeps the metadata from automaticaly downloading, and i have to get in there and delete "Legion - ". hence, not cosmetic
your revised regexp makes that same filename pop up like this:

Firemask {Title} Legion {Series}

but again like i pointed out earlier, if there is a number in the series (which there usually is) then i get this "[1]" next to every series name and number. it's always "[1]".
dkritso109 is offline   Reply With Quote
Old 10-04-2010, 06:49 PM   #39
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Yeah, that's because I misjudged the quantifiers greediness, I think. I might try to find a working regexp tomorrow, as it's currently really damn late here.
Until then, remember that tutorial I keep going on about? Go read it. Seriously. It's worth it.
Manichean is offline   Reply With Quote
Old 10-04-2010, 07:10 PM   #40
dkritso109
Enthusiast
dkritso109 began at the beginning.
 
Posts: 43
Karma: 10
Join Date: Jun 2010
Device: Kindle 3
thanks for the help, you have a good night. i have been glancing at the tutorial all day, will give it a good study later. i'm kinda all calibre'd out myself. been working on this non-stop since yesterday, and still only like 50% done.
dkritso109 is offline   Reply With Quote
Old 10-04-2010, 08:46 PM   #41
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by dkritso109 View Post
Bunch, Chris - Legion 01 - The Last Legion
this is what comes up in the {Series} field:
Legion 01 [1]
when i input this:
Bunch, Chris - Legion 02 - Firemask
this comes up in the {Series} field:
Legion 02 [1]
i get this "[1]" next to every series name and number. it's always "[1]".
The [1] means it always thinks that this is the first book in a new series.

Try this:
Code:
^((?P<author>([^\_\-0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?((?P<series>[^0-9\-]+) ([-#] ?)?(?P<series_index>[0-9.]+)?\s*-\s*)?(?P<title>.+)
It will handle all these and more:
Bunch, Chris - Legion - Firemask.pdf
Bunch, Chris - Legion 01 - Firemask.pdf
Bunch, Chris - Legion #02 - Firemask.pdf
Bunch, Chris - Firemask.pdf
Starson17 is offline   Reply With Quote
Old 10-05-2010, 07:13 AM   #42
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Just for interest - why do you want the Series field in the Calibre title field? I would have thought that it makes more sense to use the Calibre Series and series-index fields for their intended purpose.

Note that you can get the Series field added to the Filename during Send to Disk/Device operations using the filename mask, and added to the title metadata during these operations using the (recently added) Plugboard feature while still keeping the copy in the calibre library unchanged.
itimpi is offline   Reply With Quote
Old 10-05-2010, 09:03 AM   #43
dkritso109
Enthusiast
dkritso109 began at the beginning.
 
Posts: 43
Karma: 10
Join Date: Jun 2010
Device: Kindle 3
i didn't know you could do that, and when i stopped keeping the series in the title my life became all that much easier. at first i assumed that the series title was lost in respect to the filename and i wanted to be able to keep track of the order of my series whe nthe books were on another device. i had no idea about the filename mask.
dkritso109 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression Help Azhad Calibre 86 09-27-2011 02:37 PM
Regular Expression Help smartmart Calibre 5 10-17-2010 05:19 AM
Sigil 024 and regular expressions on "all HTML files" WS64 Sigil 4 08-13-2010 07:33 PM
Help with the regular expression Dysonco Calibre 9 03-22-2010 10:45 PM
Help: Is there a search expression for "books without Series"? LARdT Calibre 3 01-20-2010 09:34 PM


All times are GMT -4. The time now is 07:56 AM.


MobileRead.com is a privately owned, operated and funded community.