Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 08-09-2019, 03:13 AM   #1
Patrick Derwael
Enthusiast
Patrick Derwael began at the beginning.
 
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!
Patrick Derwael is offline   Reply With Quote
Old 08-09-2019, 04:06 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
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>.*)
I've tried it on most of the sample and it worked.
davidfor is offline   Reply With Quote
Advert
Old 08-09-2019, 04:24 AM   #3
Patrick Derwael
Enthusiast
Patrick Derwael began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
Quote:
Originally Posted by davidfor View Post
The following looks like it will work:

Code:
(?P<author>.+) - (?P<published>.+) - \[(?P<series>.*)( - T)?(?P<series_index>[0-9]*)\] - (?P<title>.*)
I've tried it on most of the sample and it worked.
Hi David,
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
Attached Thumbnails
Click image for larger version

Name:	2019-08-09 10_23_14-calibre - Preferences - Adding books.png
Views:	119
Size:	10.7 KB
ID:	172843  
Patrick Derwael is offline   Reply With Quote
Old 08-09-2019, 07:28 AM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
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>.*)
And "Published" is the publishing date, not just the year. If you set just the year, it will use the current day and month.
davidfor is offline   Reply With Quote
Old 08-09-2019, 07:49 AM   #5
Patrick Derwael
Enthusiast
Patrick Derwael began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
Quote:
Originally Posted by davidfor View Post
I could have sworn that worked. Try the following:

Code:
(?P<author>.+) - (?P<published>.+) - \[(?P<series>.*?)( - T)?(?P<series_index>[0-9]*)\] - (?P<title>.*)
And "Published" is the publishing date, not just the year. If you set just the year, it will use the current day and month.
Super mega thanks!
This is exactly what I wanted
and again
Patrick Derwael is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 06:41 PM.


MobileRead.com is a privately owned, operated and funded community.