![]() |
#1 |
Connoisseur
![]() Posts: 85
Karma: 10
Join Date: Nov 2015
Device: tablet
|
Titles
hi,
I would like to remove the text up to the second "-" character in all the titles of my many books, maybe someone can tell me how to do it? Thanks and bye |
![]() |
![]() |
![]() |
#2 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 309
Karma: 1645952
Join Date: Jun 2012
Device: none
|
You can do it with a regular expression.
First, select the books you want to modify. Edit Metadata -> Edit Metadata in Bulk -> Search and Replace tab. Search Mode: Regular Expression Search field: Title Search for: ^.*?\-.*?\- Replace with: (leave this field blank) I can explain the pieces of the regular expression if you want, but if all you're interested in is just getting something that works and you don't care why it works, I'll just leave it at that. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Connoisseur
![]() Posts: 85
Karma: 10
Join Date: Nov 2015
Device: tablet
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 309
Karma: 1645952
Join Date: Jun 2012
Device: none
|
^ : Only match from the start of the text. That way, if you start with a title with 4 dashes it won't match twice because the second pair doesn't come at the beginning.
. : Match any character. * : Match zero or more. So .* matches any number of any character. ? : Make the preceding a non-greedy match. Otherwise, a dash would itself count as "any character" and therefore the regex would match the last two dashes instead of the first two. \- : Escapes the dash. Dashes have meaning in regular expressions, so escaping it causes it to be treated as a literal dash. So using the first title from your thumbnail: ^.*?\- matches Al Kalak Mateo - (any number of any character followed by a dash) The second .*?\- matches 2024 - (same reason) Because you're replacing the matched text with nothing, the result is everything else: Fuoco e fiamme: Storia e geografia dellInferno Note that I didn't include anything to deal with leftover white space (i.e. the space after the second dash) because Calibre automatically trims white space from the beginning of titles. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
10% Credit Towards Great on Kindle Titles When Purchasing One of Those Titles | Manabi | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 11-01-2019 01:07 AM |
fixing mising titles/addition titles | Rellwood | Library Management | 2 | 08-21-2019 04:34 PM |
I Love Titles. Do you Love Titles? What's your Favorite Title? | kennyc | General Discussions | 106 | 01-19-2012 11:32 AM |
Titles, subtitles & alternative "display" titles | jigme | ePub | 2 | 08-31-2011 05:19 PM |
PRS-600 Titles | trout | Sony Reader | 3 | 04-11-2010 04:40 PM |