![]() |
#1 |
Enthusiast
![]() Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
|
file name structure for import
Hi there,
I'm normalising my ebooks file names in order to reimport them in a clean new library and I'm tearing my hair off trying to guess the proper regular expression for import Obviously, I went through the tutorial, but being no IT guy, this is somewhere in between Japanese and Chinese to me... I also went through a number of articles found on Regular expression, but they are just frightening... Concretely, all my ebooks have the following file name structure: Author - Year - [Serie - Index] - Title.epub Some examples: A.E. Van Vogt - 1939 - [] - La faune de l'espace.epub A.E. Van Vogt - 1943 - [Marchands d'armes - T01] - Les armureries d'Isher.epub A.E. Van Vogt - 1946 - [] - A la poursuite des Slans.epub A.E. Van Vogt - 1948 - [Le Non-A - T01] - Le monde des Non-A.epub A.E. Van Vogt - 1951 - [Marchands d'armes - T02] - Les fabricants d'armes.epub A.E. Van Vogt - 1952 - [] - Mission stellaire.epub A.E. Van Vogt - 1956 - [Le Non-A - T02] - Les joueurs du Non-A.epub I was hoping that the following would have done the job, but not quite... (?P<author>) - (?P<published>) - [(?P<series>) - (?P<series_index>)] - (?P<title>). If needed, I can rename my epubs to another file structure to accomodate the import Could someone let me know which code/string I should use? Thanks a bunch! |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
The following looks like it will work:
Code:
(?P<author>.+) - (?P<published>.+) - \[(?P<series>.*)( - T)?(?P<series_index>[0-9]*)\] - (?P<title>.*) |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Enthusiast
![]() Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
|
Quote:
Thanks a lot for the suggestion We are getting closer, but not there yet: the series index is not parsed properly Also, I'm wondering why the year published is shown with month & day... Screen shot attached |
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I could have sworn that worked. Try the following:
Code:
(?P<author>.+) - (?P<published>.+) - \[(?P<series>.*?)( - T)?(?P<series_index>[0-9]*)\] - (?P<title>.*) |
![]() |
![]() |
![]() |
#5 | |
Enthusiast
![]() Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
|
Quote:
This is exactly what I wanted ![]() ![]() ![]() ![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Import Author And Title From Filename & Import Other Tags And Cover From File | DazJWood | Library Management | 25 | 10-06-2021 10:18 AM |
Import epub - structure de noms de fichiers | Patrick Derwael | Software | 0 | 08-09-2019 02:50 AM |
Mixed folder structure - How best to import? | yogi62 | Library Management | 4 | 04-30-2017 06:14 PM |
'File, Import Files' and 'Add File' redundant? | phossler | Editor | 2 | 01-06-2014 12:55 AM |
File Structure Question | Tiburon | Calibre | 2 | 01-11-2010 09:21 PM |