0

I need some help with regex, or maybe templates if regex isn't the best way. I know nothing about Python and am just getting into Regex because of Calibre.

Trying to add some metadata to columns during import.

I have a magazine collection with 2 levels of folders, 1 root level and 1 sub level folder with all the magazines from that year. The top level is the magazine name such as "Make", then underneath the year folder(s) with the issues inside for each year. Each issue is named with the month and year, such as: December 2018.pdf

What I have done is just pulled out all the magazine files and placed them flat in another folder. I am looking to Parse the filename for the month and year and place that data into .

Tried A lot of regex things and have got as far as matching some data with various regex experiments. Everything just goes into the Title field on the regex test page. How come something like this doesn't populate with the year ?

(?P[^_0-9-]+)

I understand as far as parsing the filename to find a match. I am at a loss as to the high level next steps as well.

  1. Assuming I have found a matching filename, do I need to "capture" the data, or is it captured when parsed ?

  2. I am thinking of doing a column with just the year, and trying the month Year and using series to sort each mag chronologically.

  3. maybe just putting each item into it's own column.

Any help would be appreciated.

1 Answer 1

0

You might try using the existing Path column, which can be parsed for files already added to the Calibre library, as well as new additions.

Calibre Path

Define a Custom Column, and create a Template parsing the Path and Title as you wish.

Edit Custom Column

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.