|03-03-2012, 01:30 PM||#1|
Join Date: May 2011
Device: Kindle Paperwhite
Metadata from filename (regular expressions)
sorry for this stupid questions, but I really suck at regular expressions and the default ones in Calibre do not work for me.
I would like to import big collection of books and I would like Calibre to extract the metadata from the filenames. I have following different filenames:
Adams Douglas, Carwardine Mark - Last Chance to See.txt
Adams Douglas - Dirk Gently: The Long Dark Tea Time of the Soul.txt
Adams Douglas - Mostly Harmless.txt
And here are the question:
1. which regular expression do I use to extract both authors from the filename, but it has to work also when there is only one author
2. I would like to have the text which is after "-" as the name of the book and to extract the series and the number of the series from this text also (if there are any)
I was able to change on default Calibre string to extract the second type of filename correctly, but it did not work with the first and the last one. Is there a way to handle these different filenames automatically or do I have to make manual corrections? I can of course change the filenames if it is needed, but it is really a lot of work and I would prefer to solve this by using the regular expression.
I have read also the tutorial for the regular expression, but as already mentioned I suck at it and was unable to use them correctly.
Thank you very much for your help.
Edit: new idea - maybe I can split the books in several groups depending on the filename and use different regular expressions, but I still need help with creating the correct expressions
|03-05-2012, 02:10 PM||#2|
Join Date: Jan 2010
Location: Long Island
Device: Nook, REB 1100, Ebookwise 1500, Jb-Lite, PRS-650, PB302, Asus T-90MT
Have you looked at this thread Regex: File Renaming Pre-Import & Importing by penguinaka? I don't think you can account for all the variables at once, not without some serious regex knowledge which I really don't have either, but it should give you the expressions you want for each type of example. Hope it helps.
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Help with regular expressions||MostlyCarbon||Library Management||0||02-04-2012 04:00 PM|
|Regular Expressions||geormes||Calibre||4||08-04-2011 08:09 AM|
|Regular Expressions||littleezza||Conversion||1||07-15-2011 12:52 PM|
|Another help with regular expressions||encapuchado||Library Management||6||06-21-2011 04:14 PM|
|Help with Regular Expressions||ghostyjack||Workshop||2||01-08-2010 12:04 PM|