06-05-2012, 07:34 AM | #1 |
Member
Posts: 13
Karma: 10
Join Date: Jun 2012
Location: UK
Device: Kindle
|
Capitalising Book Titles
I realise there is a way to capitalise the main words in a book title by right clicking on it whilst editing the metadata but I prefer to have all words capitalised i.e. Of, The, And etc.
Is there an easy way of automating this task? Thanks, David. |
06-05-2012, 08:01 AM | #2 | |
Well trained by Cats
Posts: 29,806
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Seriously, you are asking for a feature that is a non-standard one. Title case and All Caps are what I see in use, (The only purpose I see for lower is to clean a total mish-mash so it is easy to raise. This might be in place because the same procedures are used many places where it is relevant.) |
|
Advert | |
|
06-05-2012, 09:30 AM | #3 |
Member
Posts: 13
Karma: 10
Join Date: Jun 2012
Location: UK
Device: Kindle
|
Hmmm so are you saying no then? if so is there a way of implementing it... user script files?
|
06-05-2012, 07:11 PM | #4 |
Fanatic
Posts: 519
Karma: 2693434
Join Date: Dec 2009
Location: Australia
Device: Cybook Gen 3, Pocketbook 902, Sony 650
|
I might be missing something here, but why can't you use Search and Replace in Edit Metadata?
That's the way I have done the reverse on many occasions. |
06-06-2012, 02:32 AM | #5 |
Member
Posts: 13
Karma: 10
Join Date: Jun 2012
Location: UK
Device: Kindle
|
Hi Jozawun, it's probably me that's missing something here but I make no excuses as I'm brand new to Calibre and need all the help I can get. If you say there is a way of automating the task of searching my library (that I have just added approx 1500 books to) for instances of e.g. book title 'the Amazing Maurice and his Educated Rodents' and replacing it with 'The Amazing Maurice And His Educated Rodents' then I'd appreciate it if you could let me know how to do it.
Thanks in advance, David |
Advert | |
|
06-06-2012, 04:04 AM | #6 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
As Jozawun says, you can get close to what you want using bulk metadata search/replace.
1) Select 2 books to experiment. Ensure that at one is "correctly" capitalized and that the other needs changes. 2) Type 'E' to get to bulk metadata edit. 3) Select the search/replace tab. 4) Change "Search mode" to "Regular Expression" 5) Change "Search field" to "title" 6) Enter "(^| )(.*?)( |$)" (without the quotes) into "Search for". It would be best to copy/paste the string because are spaces inside the regular expression 7) Enter "\1\2\3" (without the quotes) into "Replace with" 8) Change "Apply function ..." to "Capitalize" 9) Look at the test results to ensure that the two books are now capitalized the way you wish. 10) Press OK. If you like the result, select more books and follow the steps again. Notes: - This process capitalizes strings of letters surrounded by spaces. Hyphenated words and words containing punctuation will not have internal letters changed. - Uppercase letters in the middle of strings will be changed to lowercase. For example, IBM will become Ibm and iTunes will become Itunes. There are ways around this problem but the regular expression will become more complex than I want to deal with. - Make a backup of your library before doing this process on many books. You can destroy your library if you get something wrong or if the process does something unexpected. FYI: the "Search for" regular expression looks for (a space or the beginning of the title) followed by (the shortest sequence of characters possible to make the next sub-expression match) followed by (a space or the end of the title). The replacement puts what was found back into the title after applying the Capitalize function. |
06-06-2012, 10:17 AM | #7 |
Member
Posts: 13
Karma: 10
Join Date: Jun 2012
Location: UK
Device: Kindle
|
Hi and thanks for trying to help me, I tried what you said but this only capitalises the first word i.e. it changed 'the Bear and the Dragon' to 'The Bear and the Dragon' - I would like it to be 'The Bear And The Dragon'
cheers, David. Last edited by wydchr; 06-06-2012 at 10:24 AM. |
06-06-2012, 10:40 AM | #8 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
My fault -- I "improved" the regular expression when I posted without actually testing the improvement, and of course the change broke it.
Use "(.*?)( |$)" in "Search for" and "\1\2" in "Replace with". NB: This regexp produces incorrect results when a title contains multiple spaces in a row. This screen capture shows what it does. |
06-06-2012, 11:02 AM | #9 |
Member
Posts: 13
Karma: 10
Join Date: Jun 2012
Location: UK
Device: Kindle
|
Wow thanks chaley that did the trick, so can I use that method to check and change my whole library in one go or should I just use it on a few titles at a time?
Oh and one other thing, what exactly do the regular expression symbols mean and how would I have known to do that if I hadn't asked on the forum... not really important now I know but I am curious as to how it works. cheers, David Last edited by wydchr; 06-06-2012 at 11:06 AM. |
06-06-2012, 11:14 AM | #10 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You can select as many books as you wish, then apply the search/replace.
Changing the title can be quite time consuming in calibre. Changing one title could take approximately a second, so the number you change at a time will depend on your patience. Changing large numbers of books could make it harder to eyeball the results. I would probably do a screen at a time, checking the results. I would save the search/replace to make it easier to repeat it on the next screen. I would choose this approach because I am a bit paranoid about using "fire and forget" with this sort of operation, a trait you might not share. |
06-06-2012, 11:26 AM | #11 |
Member
Posts: 13
Karma: 10
Join Date: Jun 2012
Location: UK
Device: Kindle
|
Thanks again Charles, I will save the expression for later.
David. p.s. I may ask more questions later if that's OK... perhaps something along the lines of swapping author and titles over as I have found some of my books have the title as author and vice versa. No biggie really but would be nice to have a similar way of doing that Last edited by wydchr; 06-06-2012 at 11:30 AM. |
06-06-2012, 11:32 AM | #12 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@wydchr - there are already two ways of doing this - for a single title just do it on the edit metadata dialog (there is a button with green/white arrows on it on the top left). For multiple titles, just select them, use the bulk metadata dialog and there is an option on there to swap title/author as well.
|
06-06-2012, 11:34 AM | #13 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@kiwidude: he doesn't want to use the titlecase function, because that does not capitalize the "small" words such as "the", "and", and the like.
|
06-06-2012, 11:49 AM | #14 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@chaley - I know - I was responding to his latest question of how to swap title and author
|
06-06-2012, 11:54 AM | #15 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@kiwidude: sorry -- didn't see his edited post. Yet again I am shown not to trust the emailed versions. Someday I might actually exhibit learning behavior.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Better Book Titles... | Coops | General Discussions | 4 | 05-05-2011 01:52 AM |
Book titles are different | barth90 | Calibre | 10 | 05-18-2010 05:41 PM |
Series and Book Titles | jjansen | Calibre | 10 | 04-14-2010 12:14 PM |
Unutterably Silly Book Titles We Would Like To See | RWood | Lounge | 8 | 02-16-2009 11:57 AM |
Book Titles | dhbailey | Sony Reader | 7 | 03-12-2007 12:07 PM |