ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Kanyimbe on August 23, 2010, 04:11:03 AM

Title: Creating a directory listing of files
Post by: Kanyimbe on August 23, 2010, 04:11:03 AM
I've been working on this concept for creating an enriched directory of files. I've been finding the exiftool could work great for this.

exiftool(-k -w .txt -Title -Subject -Author -PageCount -FileSize)

For example this code for PDFs gives some useful info for each file.

My idea has been to have exiftool reside in a directory and when the index.htm file is opened, the directory listing will be updated with the latest content and its metadata complete with links to the prospective files.

The thing I haven't figured out is:

How to dump the contents into an index.html file template (body, html etc)?

Thanks for any ideas.

D
Title: Re: Creating a directory listing of files
Post by: Phil Harvey on August 23, 2010, 07:45:55 AM
You can output metadata in any format you want with the -p option.  See the Reverse Geotagging (https://exiftool.org/geotag.html#Reverse) documentation for some examples of -p format files.  You should be able to use this to do exactly what you want.

Also, there is a -h option which formats output in HTML table form, but you would have to handle the HTML header/footer if you use this.

- Phil
Title: Re: Creating a directory listing of files
Post by: Kanyimbe on August 23, 2010, 02:29:20 PM
Thanks,

Sorry to sound like a n00b but I haven't figured out how to output to a file because when I use > Windows XP says that's not valid in the filename. How does that work?
Title: Re: Creating a directory listing of files
Post by: Phil Harvey on August 23, 2010, 04:47:17 PM
The command-line redirection ">" can't be done by putting options in the "exiftool(-k).exe" file name as you have discovered.

You can either run cmd.exe and type in the command, or make a batch (.BAT) file with the command you want to run.  With the batch file you can drag and drop if that is what you want.

The .BAT file will have a command something like this:

exiftool -p "c:\my files\my_format.fmt" %* > "c:\my files\my_output_file.txt"

Then when you drag and drop files and folders on the .BAT file, you will get an output file with the results.  The %* in the above command will be replaced by the name of all files/folders you drop on the .BAT file.  For the above command to work, "exiftool.exe" must exist somewhere in the PATH.  See the Windows install instructions for command-line use if you need help with this.

If you run into any troubles, let me know.

- Phil
Title: Re: Creating a directory listing of files
Post by: Kanyimbe on August 24, 2010, 06:54:28 AM
Thanks so much for this info (which I've forwarded to the guy that is now helping me)! I'm really excited about the potential of this tool.
Title: Re: Creating a directory listing of files
Post by: Kanyimbe on March 08, 2011, 03:25:38 AM
Just thought I'd add here that I've recently made some progress on this thanks to the good advice about using FMT. You can see my post here: http://kanyimbe.posterous.com/ubiqivos-come-back-to-haunt-us

Thanks, a lot.
Title: Re: Creating a directory listing of files
Post by: Phil Harvey on March 08, 2011, 07:05:20 AM
Thanks for the link.  One minor correction to your blog: ExifTool is Perl, not Python.

- Phil