Quote:
Originally Posted by dhbailey
I'm not sure it can be -- how will title / author /author-sort info be entered for each book, if you don't do it manually? It's not like files will all have this data in clearly recognizable areas so that the program can generate it automatically.
|
Unless you're naming your files to a particular scheme, which you can parse to obtain the meta-data, e.g. "Drake, David - RCN 01 - With the Lightnings.lit".
With that, something like the following can parse the name...
Code:
dash = file.find(' - ')
if dash != -1:
fileAuthor = file[:dash]
dash = file.rfind(' - ') # Search back to allow for series seperators
fileTitle = file[dash+3:-4]