Quote:
Originally Posted by Tanjamuse
In the batch of files that I sent you, sometimes the title of the file in calibre doesn't match with what's in the txt-files (neither does the authors)
Can I edit the title batch so that it matches what's in a specific line in a txt-file?
It's always line #4 for the title and line #6 for the authors.
|
See the attached. Note that it is not "always" where it should be; just almost always. Also, 2 of the 20 books had no match at all (per the lower left corner statistics), so they have some other nonconformity.
I highly recommend Pythex to prototype and test your regular expressions. MCS always uses RE options Multiline, Ignorecase and Dotall, so you should always activate those options in Pythex (as shown in the image attached below).
Added: you may need to add some special characters to the regular expression to account for Titles that have quotes, semi-colons, periods, etc. So, "^\s+[a-zA-Z0-9 ]+\n" may need to be something like "^\s+[a-zA-Z0-9 ,';"]+\n" and so forth. Regular expressions use odd characters as its control characters, so you may need to "escape" them in your regular expression so it treats them as your characters, and not its control characters. Pythex will tell you when you get it right (or wrong).
DaltonST