09-20-2010, 03:57 PM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: Sep 2010
Device: Android
|
Regex and Metadata from filename.
Thanks very much for taking the time to read this.
I tried reading as much as I could about regular expressions, and even being a hobbyist programmer it makes my head spin. I have some books that are parsed strangely, and I was wondering if anyone could help me. Here is an example filename: Code:
[Black Fleet Crisis] - 01 - Before The Storm (Michael Mcdowell).epub Code:
(?P<title>.+) \((?P<author>[^_]+)\) EDIT: I found a thread that lets me parse the brackets out into some into publishdate, so now all I need to do is figure out how to get the numbers to disappear. |
09-20-2010, 04:22 PM | #2 | |
Wizard
Posts: 3,450
Karma: 10484861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
|
Quote:
Code:
[Black Fleet Crisis] - 01 - Before The Storm (Michael Mcdowell).epub Code:
.* - (?P<title>.+) \((?P<author>.+)\) Have a look at this thread https://www.mobileread.com/forums/showthread.php?t=99258 Last edited by kacir; 09-20-2010 at 04:24 PM. |
|
Advert | |
|
09-20-2010, 05:13 PM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: Sep 2010
Device: Android
|
Awesome! It works nearly perefectly. It fails on books that are not part of a series (title author only) but I have so few of those I can just group them in thier own folder and import them as a second group with different regex.
Calibre is the perfect tool for what I need, and I'm glad you guys are here to give answers. thanks! |
12-01-2023, 08:55 AM | #4 |
Junior Member
Posts: 3
Karma: 10
Join Date: Dec 2023
Device: Kindl
|
can you please tell me which tool or plugin from Calibre you use?
I also want to convert my filenames into meta-data that can be read by my Tolino or my Kindle. I dont want to edit all metadata by myself manually. I have filenames like: name, surname - title.epub thanks a lot |
12-01-2023, 01:49 PM | #5 |
Well trained by Cats
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
The Send to device, save to Disk Template controls file names on sending.
If you have used a DEVICE, reconnect it The Preferences:send to device will show the current template and info needed to modify. It may be simple as : (did put the books in an Authors folder by using a / ) {authors}/{title} Use {author_sort} if main Calibre is Fn Ln, that flips |
Advert | |
|
12-03-2023, 04:51 AM | #6 | |
Junior Member
Posts: 3
Karma: 10
Join Date: Dec 2023
Device: Kindl
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Metadata in Title/filename | mezme | Calibre | 0 | 08-18-2010 03:08 AM |
Metadata Filename Syntax | gandor62 | Calibre | 15 | 07-18-2010 03:46 AM |
Need help with metadata by filename | artbatista | Calibre | 17 | 12-19-2009 07:51 AM |
Little Help with Metadata from Filename needed | plunderydoo | Calibre | 4 | 09-06-2009 08:34 AM |
Metadata from filename problem | kad032000 | Calibre | 0 | 05-24-2009 02:26 AM |