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 08-23-2014, 11:56 AM   #1
comox
Enthusiast
comox began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Jan 2011
Device: none
regular expression to convert character when adding book

Hoping there might be a regular expression expert that can help me.

I would like to convert "_" to ":" in the file name title when adding books.

For example:
John Doe - Cooking_ With Gas - 2014

Using:
(?P<author>[^_]+) - (?P<title>.+) - (?P<published>.+)

Is there a modification I can make so that the imported title is "Cooking: With Gas".
comox is offline   Reply With Quote
Old 08-23-2014, 12:51 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,933
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by comox View Post
Hoping there might be a regular expression expert that can help me.

I would like to convert "_" to ":" in the file name title when adding books.

For example:
John Doe - Cooking_ With Gas - 2014

Using:
(?P<author>[^_]+) - (?P<title>.+) - (?P<published>.+)

Is there a modification I can make so that the imported title is "Cooking: With Gas".
colon is a reserved filesystem character.
C:
LPT1:
NUL:
theducks is offline   Reply With Quote
Advert
Old 08-23-2014, 12:55 PM   #3
comox
Enthusiast
comox began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Jan 2011
Device: none
Thanks. I understand colon is reserved. That's why ":" was converted to "_" when saving the title in the filename. I would like to reverse the process and convert "_" to ":" when adding a book to my library.
comox is offline   Reply With Quote
Old 08-23-2014, 12:57 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,242
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You cannot run regular expression on filenames while importing, you can run them in bulk via the search replace tab of the bulk metadata edit dialog, after importing.
kovidgoyal is offline   Reply With Quote
Old 08-23-2014, 01:15 PM   #5
comox
Enthusiast
comox began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Jan 2011
Device: none
got it, thanks
comox is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre book adding: Regular expression request... Spiffy Calibre 34 01-19-2016 01:03 PM
Regular Expression adding book published date jbcmars Calibre 2 01-08-2011 09:23 PM
Adding Books, regular expression smarties86 Calibre 4 12-19-2010 08:18 AM
Regular Expression on adding books. Lokro Calibre 4 11-06-2010 11:05 AM
Regular Expression For Adding Books jhart711 Calibre 3 09-27-2010 06:51 AM


All times are GMT -4. The time now is 12:11 AM.


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