![]() |
#1 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 20236
Join Date: May 2014
Device: Kinde PW v1, Kobo H2O, Onyx Boox T68
|
Fill fields with filenames
Greetings...
I am trying to fill <series> and <series_index> automatically from filenames. So i am trying to build a regular expression. Files are allways named like that : NAME First-Name - Title-of the book.mobi or [Name-of the serie-1.5]Title-of the book.mobi Sometimes i can find a space after the "]". Sometimes, 1.5 is written 1,5 and it would be perfect if the code can deal with that ![]() For now, my code looks like that : Code:
\[(?P<series>.+)\-(?P<series_index>[0-9]+((\.|,|)[0-9]?))?\](?P<title>.+) and if the number is "1,5", it is just ignored. Can you help me, please ?? ![]() Thank you in advance ![]() |
![]() |
![]() |
![]() |
#2 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 20236
Join Date: May 2014
Device: Kinde PW v1, Kobo H2O, Onyx Boox T68
|
I found it myself.
Code:
(\[(?P<series>.*)\-(?P<series_index>.*)\]\s*)?((?P<author>.*) -)?\s*(?P<title>.*) ? author - title.mobi [Serie-1.5]title.mobi [Serie-1.5]author - title.mobi But the title is allways replaced by the one found in the metadata Grrrr. If i don't use metada, i lose all the other tags. For now, i want to use a custom column : custom_title But if i use it in my regular expression (?P<custom_title>) nothing happens ! Any idea, please ?? |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@myki - Try #custom_title
Custom column names are normally (always ???) prefixed with a '#' BR |
![]() |
![]() |
![]() |
#4 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,048
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#5 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 20236
Join Date: May 2014
Device: Kinde PW v1, Kobo H2O, Onyx Boox T68
|
Thank you BetterRed and Theducks for your help.
i tried (?P<#custom_title>) and #custom_title, but as soon as i add a #, Calibre is not agree ![]() I read old threads saying that it is impossible to fill custom fields from filename, is it still the case ?? |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
![]() |
![]() |
![]() |
#7 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 20236
Join Date: May 2014
Device: Kinde PW v1, Kobo H2O, Onyx Boox T68
|
You are right BetterRed, i gave up by this way.
I have automated it by using ebook-meta.exe in a "Direcory Opus" button, and then work on my titles usign regex in Calibre. It would have been so simple if i could prevent Calibre to modify my titles found with filenames, with those found in books metadata (or i don't use them, but i lose covers and other metadatas). Thanx for your help anyway ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sorting Fields/Tags within Fields/ Tags? | mattlauck | Library Management | 9 | 10-19-2013 10:46 AM |
Did you fill your eink reader? | jocampo | General Discussions | 49 | 05-28-2011 09:23 PM |
How to get cover to fill screen? | seagull | Amazon Kindle | 11 | 03-15-2011 12:05 PM |
Filenames to metadata, preserving filenames. | nitrogun | Calibre | 5 | 09-13-2010 10:50 PM |
Could you help me to fill in the questionniare? | GreX | News | 0 | 11-26-2008 08:37 PM |