Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-03-2025, 10:48 AM   #1
gianni_1
Connoisseur
gianni_1 began at the beginning.
 
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
Attached Thumbnails
Click image for larger version

Name:	Title.jpg
Views:	69
Size:	37.6 KB
ID:	214836  
gianni_1 is offline   Reply With Quote
Old 04-03-2025, 05:20 PM   #2
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
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.
fidvo is offline   Reply With Quote
Advert
Old 04-04-2025, 04:56 AM   #3
gianni_1
Connoisseur
gianni_1 began at the beginning.
 
Posts: 85
Karma: 10
Join Date: Nov 2015
Device: tablet
Quote:
Originally Posted by fidvo View Post
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.
Yes, I would really like to know the meaning, thanks.
gianni_1 is offline   Reply With Quote
Old 04-04-2025, 02:36 PM   #4
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
Posts: 309
Karma: 1645952
Join Date: Jun 2012
Device: none
Quote:
Originally Posted by gianni_1 View Post
Yes, I would really like to know the meaning, thanks.
^ : 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.
fidvo is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 06:41 AM.


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