|
|
#1 |
|
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Aug 2010
Device: Nuvi
|
Need Help Creating a Regular Expression
Star Wars - [Boba Fett 01] - The Fight to Survive (by Terry Bisson).pdf The Output I would like in Calibre would be: Book Title: The Fight to Survive Author: Terry Bisson Series: Star Wars - Boba Fett and then the #1 for the sequence in the series. Is this possible via a Regular Expression?
|
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,127
Karma: 77366
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Should be possible. Take a look at the preferences, specifically the add/save books- page, which links to a handy reference for regular expressions as well as offering a test input thingy. You should be good from there.
__________________
I reject your reality and substitute my own. |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,855
Karma: 285886
Join Date: Jan 2010
Location: France
Device: Sony PRS-300, HTC WM6.5, Samsung Galaxy Nexus, HTC Sensation
|
I can get close, but not perfect.
Testing using the file name you supplied Code:
Star Wars - [Boba Fett 01] - The Fight to Survive (by Terry Bisson).pdf Code:
(?P<series>(.+?))(?P<series_index>\d+)\] - (?P<title>.+) \(by (?P<author>.+)\) I see two ways to deal with the extra '['. The first is to rename the files before importing to calibre. I would generate a text file containing all the book names, then edit that file to create a batch/shell script to rename the books. stripping away the leading '['. If the batch operation isn't something you want to try, then I would run the import, then use the 'manage series' dialog available from the tag browser to manually remove the '[' character from each series. Manually correcting the series this way shouldn't take too long, around 1 to 2 seconds per series. See the attached screenshot to see the regexp in action.
__________________
Support calibre developers at no cost to you by using calibre's get books feature. Use Calibre Companion to wirelessly connect your Android phone or tablet to calibre charles.haleys.org/calibre |
|
|
|
|
|
#4 |
|
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Aug 2010
Device: Nuvi
|
Brilliant and my most sincere thanks! I will try this after work today.
|
|
|
|
|
|
#5 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 93
Karma: 8282
Join Date: Jan 2010
Device: Kobo Touch, Kindle3, Xoom
|
If you want to do a lot of batch file-renaming before importing into Calibre, look long and hard at the Name It Your Own Way tool.
That tool has saved me hours of time. |
|
|
|
|
|
#6 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,855
Karma: 285886
Join Date: Jan 2010
Location: France
Device: Sony PRS-300, HTC WM6.5, Samsung Galaxy Nexus, HTC Sensation
|
Quote:
![]() The tool is at http://www.niyow.com/.
__________________
Support calibre developers at no cost to you by using calibre's get books feature. Use Calibre Companion to wirelessly connect your Android phone or tablet to calibre charles.haleys.org/calibre |
|
|
|
|
|
|
#7 |
|
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Aug 2010
Device: Nuvi
|
I'm on a Mac so Terminal is great so long as I get the commands right. Else, this is a great GUI on OSX: http://manytricks.com/namemangler/.
Those Regular Expressions worked perfectly for my files, by the way. Thank you again! |
|
|
|
|
|
#8 | |
|
Warthog Driver
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 617
Karma: 4911
Join Date: Jul 2007
Location: Grapevine, TX
Device: iPad4
|
Quote:
I hate software that will not tell you how much it costs unless you install it on your PC. I see no link on the site where you can see the cost or buy it. They don't even tell you it is shareware but I inferred it by the "download free" label. |
|
|
|
|
|
|
#9 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,855
Karma: 285886
Join Date: Jan 2010
Location: France
Device: Sony PRS-300, HTC WM6.5, Samsung Galaxy Nexus, HTC Sensation
|
The news section of the website says that it is freeware.
The license agreement (included in the spoiler) says that same thing. Spoiler:
__________________
Support calibre developers at no cost to you by using calibre's get books feature. Use Calibre Companion to wirelessly connect your Android phone or tablet to calibre charles.haleys.org/calibre |
|
|
|
|
|
#10 |
|
Enthusiast
![]() ![]() ![]() ![]() ![]() Posts: 38
Karma: 412
Join Date: Sep 2009
Device: WinMobile, Hanvon N516 w. OpenInkPot, eLyricon EBX-500, Iphone 3GS
|
try this Tool for renaming:
http://www.joejoesoft.com/cms/showpage.php?cid=108 It can do regex and is extremly flexible - and its free.
__________________
Grüße Pl |
|
|
|
![]() |
| Tags |
| import, regular expression |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Regular Expression Help | Azhad | Calibre | 86 | 09-27-2011 02:37 PM |
| Regular Expression Help | smartmart | Calibre | 5 | 10-17-2010 05:19 AM |
| Help!! Having trouble with regular expression | Partzz | Calibre | 2 | 09-14-2010 12:32 PM |
| Regular Expression Help Needed | dloyer4 | Calibre | 1 | 07-25-2010 10:37 PM |
| Help with the regular expression | Dysonco | Calibre | 9 | 03-22-2010 10:45 PM |