
: Re: Command line extraction of metadata (title. author) from epub file I would like to use a command line to extract the title of a book (possibly also other metadata) from its epub file and return
Ok, so since nobody has ANY info on this online and this is the top search results. Here is what you are looking for. exiftool -a -u -g1 nameofthe.epub. This line gives you a giant output of all the metadata tags you can extract using exiftool. exiftool -t -Title -Creator -PublicationDate -CreatorFile-as nameofthe.epub this is how you use it. If you push -t lowercase it shows you the description of the tags you pulled. If you run -T uppercase, it just shows the tags. Your welcome. Enjoy.
Edit: Also, since exiftool is a GIANT PITA and their help is semi useless. Here is a few scripts I wrote for it that might help someone out. This took me forever... These are formatted for batch files with %% and ". You may need to edit
This moves any epubs in folder DIR into folders sorted by their Creator (Author).
for %%f in (DIR*.epubs) do (exiftool "%%f" "-Directory<Creator")
This renames any epubs in a folder, to the Title and Author
for %%f in (01-input*.epub) do (exiftool "-filename<$title - $creator.%%e" "%%f")
To make them recursive into subdirectories you need to change the for formatting. Example
for /R "01-input" %%f in (*.epub) do (exiftool "-filename<$title - $creator.%%e" "%%f")
Edit2: On the off chance your tags contain "illegal" characters, outlined here (https://exiftool.org/filename.html), place the tag inside {} and put a ; at the end of the tag. This strips those out so it works. Example script.
for /R "01-input" %%f in (*.epub) do (exiftool "-filename<${title;} - ${creator;}.%%e" "%%f")
Free books android app tbrJar TBR JAR Read Free books online gutenberg
More posts by @Megan