![]() |
#1 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jun 2011
Device: laptop mostly, or any other handy screen
|
Adding books with series in the filename
Can anyone please help with a regex for adding books that may optionally have a series? I have one that gets a trailing title correctly most of the tme, but series get lumped with the author name.
eg "bob smith - a long series 01 - my title.txt" I tried variations on the below but that fails, and google doesnt seem to help. (?P<author>.+)( - (?P<series> <series_index>))? - (?P<title>[^_]+) Cheers for any suggestions Last edited by genright; 06-12-2011 at 09:07 AM. |
![]() |
![]() |
![]() |
#2 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jun 2011
Device: laptop mostly, or any other handy screen
|
Another example, this works but breaks for files that do not have a series such as "bob smith - another title.txt". Also, how can I grab the series index as well?
(?P<author>.+) - (?P<series>.+)? - (?P<title>[^_]+) Last edited by genright; 06-12-2011 at 09:09 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Quack! Quack!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 92
Karma: 9176
Join Date: Apr 2011
Location: Florida
Device: kindle 3 & sony daily prs950sc
|
^(?P<author>[^-]+)(\s*-\s*(\[?(?P<series>[^-0-9]+)\s*(?P<series_index>[0-9.]+)?]?)?)?.*?-\s*(?P<title>[^\]{[()]+\w)
this one removes all brackets around the series and anything in brackets in the title section doesn't get imported imported ^(?P<author>[^-]+)(\s*-\s*(\[?(?P<series>[^-0-9]+)\s*(?P<series_index>[0-9.]+)?]?)?)?.*?-\s*(?P<title>[^-]+) this one removes brackets around the series section but leaves things in brackets in the title so you get version information imported with the title *note - i find it useful to do some file clean up prior to import with a bulk renaming software. There are 2 that are very good with Flash Renamer being my favorite the other is called Bulk Rename Utility. In these you can enter regex commands in the find and replace to clean up files or wildcards if you don't know how to use regex. Two other tools I use is ExtractNow which auto extract & deletes archives after extraction in folders and folders of folders without having to manually go there and Opus which replaces windows explorer with a comander style split screen and a view screen so you can inspect whats in any type of file without opening them it also allows you to make customized regex, find & replace rename and other stuff as buttons and place them on the menu bar. Some of the button I have created and added to the bar on Opus... for example I have a swap author and title button; swap ln, fn button; swap author, series, title button (in any combination); replace by with -; swap ln,fn & ln,fn button; and trim all double spaces and trailing space; and some others. I use flash renamer first because you can string together a bunch of commands to do in a batch command to run against your files in bulk. The any minor quick fixes i do with buttons from opus when i reinspect to make sure everything is like i like it. Cheers i hope that helps. Last edited by penguinaka; 06-12-2011 at 02:42 PM. |
![]() |
![]() |
![]() |
#4 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Quote:
You'll probably want to use something like Code:
(?P<author>.+)( - (?P<series>[^0-9]+) (?P<series_index>\d+))? - (?P<title>[^_]+) |
|
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jun 2011
Device: laptop mostly, or any other handy screen
|
Quote:
@Manichean: Thanks for the tip, I had read through that doc but didnt feel the enlightement yet. In hindsight my first attempts were indeed so flawed ![]() Really appreciate the quick feedback guys. Caliber is awesome ![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Quack! Quack!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 92
Karma: 9176
Join Date: Apr 2011
Location: Florida
Device: kindle 3 & sony daily prs950sc
|
Thanks glad it helps. I took a look at krename because i'm always after a more powerful tool but from what little i tested it i find that flash renamer covers a lot more ground and seems to be easier to use.
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] Adding new column to sort by filename | ShinRa Actual | Library Management | 20 | 02-12-2012 10:22 AM |
Assistance with adding series titles/number - Calibre 0.8.2/Nook Classic | Galora | Library Management | 0 | 05-25-2011 10:50 AM |
Adding book series to cover??? | artemisblossom | Calibre | 4 | 09-14-2010 05:31 PM |
Adding Series and Number to Title. | Cerepol | Calibre | 17 | 09-01-2010 06:50 PM |
Pet peeve: series authors who introduce things in non-series books! | ficbot | Reading Recommendations | 12 | 02-06-2010 02:14 AM |