View Single Post
Old 09-13-2010, 02:42 AM   #1
nitrogun
Junior Member
nitrogun began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2010
Device: Kindle 3
Question Filenames to metadata, preserving filenames.

Kindle 3 arriving soon. Home runs on Mac. Calibre, Stanza, Kindle for Mac installed.
A friend passed on to me a disk full of non-DRM e-books he had downloaded over the years from various sites. They are in assorted (non-drm) pdf, rtf, doc, lit formats, and I need to convert to Mobi for the kindle. None of the files appear to have metadata other than the filenames.

Stanza can convert one at a time with same file name in Kindle format, but Calibre is preferred as I can batch convert a lot to Mobi at once. But I would like to get the metadata from filenames in the new files, and filenames the same as originals, to ease the task of checking that each title has been successfully converted before deleting the old versions.

In the Calibre preferences page, under add/save, there is a field for "Regular Expression" (default appears to be " (?P<author>[^_]+) - (?P<title>.+)") followed by a test panel with field for pasting in filename so that metadata can be read from the filename and inserted into the new converted file. When I just convert it, the title and author is "Unknown" and the filename is different.
I tried looking at the "reference" link that allegedly explained it all, and was totally overwhelmed and confused as a result. Nor am I familiar with the Terminal window, and only use it with detailed printed instructions in front of me.

I pasted (into the filename test field) filenames in the 3 formats as below and pressed the "TEST" button, but no results appeared in the fields below. These formats represent the various types of filenames in the disk I was given.
Examples:
Ford, Harry - Lost 6 - Of Starting and Ending
The Sittaford Mystery - Christie_ Agatha
Anders, Ken J - Scotfree

Problem-how to batch convert files with names like the above, resulting in Author/series/title metadata from the filename being inserted into the new file,and also resulting in same filenames so that I can alphabetically sort the old and new together to check that all conversions done before deleting the originals. I will simply be loading batches into Calibre for conversion, copying the results back into original folders, checking that all are done, then deleting all original filetypes once checked, then deleting Calibre Library.

Your advice on achieving this would be appreciated, and especially if you could type out the "regular expressions" (so that I could Copy/Paste them into the field) for the three filename formats as above so they will be recognized as metadata.
nitrogun is offline   Reply With Quote