![]() |
#1 |
Member
![]() Posts: 10
Karma: 10
Join Date: Jun 2017
Device: None
|
Regular Expression in Adding Books
Let me start out by apologizing for being a non-programmer!
I have a batch of files with the file name format: "Publisher - Author - Title - Category.pdf" I wish to import these files with the metadata being populated as Publisher=Publisher, Author=Author, Title=Title, and Category=Comments. I have tried reading the tutorial and other posts online about how to format the regular expression for adding books, but frankly don't understand the nuances enough. I have tried playing with the test option and the expressions that pop up with the mouse rollover, but I can only seem to pick up the author and title. Can anyone give me some help in creating this expression? Thanks! Jeff |
![]() |
![]() |
![]() |
#2 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 885
Karma: 409970
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Have you tried the add book template as follows, to see if it works? ('P <Publicer>. +) - (? P <author> [^ _] +) - (? P <title>. +)
I do not think it is convenient for you to put the comments because they are infinite text fields. Try this waiting for a more accurate comment. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Member
![]() Posts: 10
Karma: 10
Join Date: Jun 2017
Device: None
|
Quote:
|
|
![]() |
![]() |
![]() |
#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
|
There were some extra spaces in what @dunhill posted. And that first quote probably should have been a question mark. I think what he meant was:
Code:
(?P<publisher>.+?) - (?P<author>[^_]+?) - (?P<title>.+) To get the comment as well: Code:
(?P<publisher>.+?) - (?P<author>[^_]+?) - (?P<title>.+?) - (?P<comments>.+) |
![]() |
![]() |
![]() |
#5 | |
Member
![]() Posts: 10
Karma: 10
Join Date: Jun 2017
Device: None
|
Quote:
That appears to work, thank you so much!! I appreciate everyone's help. |
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding books using Regular Expression! | leomleite | Calibre | 2 | 11-02-2014 05:51 PM |
Adding books, Regular expression help please | Shadewing | Library Management | 13 | 04-04-2012 05:31 AM |
Adding Books, regular expression | smarties86 | Calibre | 4 | 12-19-2010 08:18 AM |
Regular Expression on adding books. | Lokro | Calibre | 4 | 11-06-2010 11:05 AM |
Regular Expression For Adding Books | jhart711 | Calibre | 3 | 09-27-2010 06:51 AM |