01-22-2011, 10:05 PM | #1 |
Junior Member
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: SONY PRS-505
|
Reverse Ln, Fn?
I have just imported all my books into Calibre and unfortunately some but not all of the author names are written 'Smith, John' and Calibre is assuming that John is the last name and sorting by John. I cannot see anyway to rectify this without individually editing all the names. Is there a script/plugin to do this?
|
01-23-2011, 01:13 AM | #2 | |
Connoisseur
Posts: 54
Karma: 442
Join Date: Oct 2010
Location: Detroit
Device: iPad
|
Quote:
The "simple" way to do this is to select ONLY the books that have the authors first and last names reversed, and perform a bulk metadata edit (press the E key after Ctrl Selecting the books you want to fix). Then Go to the Search and Replace Tab. Select [Authors] in the Search Field Select [Regular Expression] in the Search Mode drop-down Field. In the Search for: field enter (.*), (.*) In the Replace with: field enter \2 \1 (check in the Test results table that the expected reversal will take place) Make sure you have selected ONLY the books with the reversed names! Make Sure you have backed up your library !! Cross your fingers Then Click OK Calibre will update the Author-Sort field automagically at the same time. The regular expression shown (.*), (.*) will only work for authors that are entered as LastName, FirstName i.e. it expects one comma and one space between a single last name and (one or more) first name(s). |
|
Advert | |
|
01-23-2011, 02:47 AM | #3 |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
|
01-23-2011, 08:40 AM | #4 |
Junior Member
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: SONY PRS-505
|
OMG! that is amazing! Worked like a treat. Thanks Garcle
|
02-23-2011, 01:10 PM | #5 | |
Member
Posts: 10
Karma: 10
Join Date: Feb 2011
Device: kindle
|
Quote:
1) Hide & seek_ a novel - James Patterson 2) Hide & seek_ a novel - Patterson_ James i have been trying to change filenames 1) to 2) use the 'Search and Replace Tab' as discribed above method with a few variations but without any success. as there is no , between the fisrt and last name i just can't get the [Regular Expression] to work. any help could be much appreciated. many thanks in advance. |
|
Advert | |
|
02-23-2011, 01:16 PM | #6 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
|
|
02-23-2011, 01:22 PM | #7 | |
Member
Posts: 10
Karma: 10
Join Date: Feb 2011
Device: kindle
|
Quote:
actually, i have both. some are already there and some are ready to Ádd, but i just cant get the regex to work correctly. Last edited by AlanY; 02-23-2011 at 01:25 PM. |
|
02-23-2011, 01:30 PM | #8 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Code:
(?P<title>.+) - (?P<author>[^_]+) For those that are already in, you'll need to provide more info about what field they are in. |
|
02-23-2011, 01:35 PM | #9 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
I reread your post, and it looks like you want to swap first name and last name in some cases. You need to get your author names all consistent and your author_sort all fixed. From then on you can use the regex I gave you to bring in the author correctly and the author_sort will fix itself. Start by fixing or reimporting everything you have now. From then on, you can import correctly and all should be fine.
|
02-23-2011, 02:01 PM | #10 | |
Member
Posts: 10
Karma: 10
Join Date: Feb 2011
Device: kindle
|
Quote:
many many thanks |
|
02-23-2011, 02:08 PM | #11 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
You're welcome, but I got you only part of the way. You'll want to decide whether you want your authors all to appear as LN, FN or FN LN. Then you want to set your tweaks so that the author_sort is set correctly when you bring in new books. (In case you aren't familiar with it, author_sort controls how your authors are sorted) Look in Preferences for the new and improved Tweaks setting screen. You may need to use Search and Replace to fix any errors you have now, but once all that's set, you won't have to use it again.
Feel free to ask if more help is needed. Good luck! |
02-23-2011, 02:45 PM | #12 | ||
Member
Posts: 10
Karma: 10
Join Date: Feb 2011
Device: kindle
|
Quote:
Quote:
Code:
(?P<title>.+) - (?P<author>[^_]+)
1) First name, and 2) Last name_first name? |
||
02-23-2011, 03:04 PM | #13 | |
Member
Posts: 10
Karma: 10
Join Date: Feb 2011
Device: kindle
|
Quote:
i've 50 books with a mixture of filenames 1) and 2) to add to the library. using the regex (?P<title>.+) - (?P<author>[^_]+) i got 33 books under the Authors LastName, FirstName, and 17 books under the authers FirstName LastName (with space inbetween). so, what regex do i need to put into the 'search and replace' to 17 to the same as the other 33? |
|
02-23-2011, 03:13 PM | #14 | |
Member
Posts: 10
Karma: 10
Join Date: Feb 2011
Device: kindle
|
Quote:
|
|
02-23-2011, 03:23 PM | #15 | |||
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Quote:
Quote:
|
|||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reverse Windowing: The Tourist Trail | johnyunker | Writers' Corner | 11 | 06-21-2010 10:13 PM |
Reverse Proxying Stanza | RoninTech | Calibre | 3 | 11-10-2009 11:20 AM |
Unutterably Silly Reverse Prank Call | NatCh | Lounge | 16 | 05-28-2009 02:03 PM |
reverse display output? | LDB | Sony Reader | 0 | 08-10-2008 11:14 PM |
Reverse engineer HandStory clips | Aragorn | Reading and Management | 3 | 04-01-2003 06:40 PM |