ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: galactichull on February 24, 2017, 10:25:26 AM

Title: Adding file extensions with metadata
Post by: galactichull on February 24, 2017, 10:25:26 AM
I'll attempt to be as clear as possible about my predicament.

Currently I have thousands of files with no extension.  They are named according to their hash.  Obviously with ExifTool I can generate a file that informs me of the extension.  That's helpful.

Is there a technique with ExifTool (or otherwise) to use the metadata to add in batch process the appropriate file extension to each file?  (I'd rather not do it one by one.)

Thank you for any help.
Title: Re: Adding file extensions with metadata
Post by: Phil Harvey on February 24, 2017, 11:08:42 AM
Things like this are easy:

exiftool "-filename<%f.$fileTypeExtension" DIR

And add -r to the command to recursively process subdirectories.

- Phil
Title: Re: Adding file extensions with metadata
Post by: StarGeek on February 25, 2017, 04:35:10 AM
Doesn't this also need an -ext *?

And when did you slip fileTypeExtension into the mix.  I can't keep up!
Title: Re: Adding file extensions with metadata
Post by: Phil Harvey on February 25, 2017, 08:35:59 AM
Quote from: StarGeek on February 25, 2017, 04:35:10 AM
Doesn't this also need an -ext *?

Right.  Good point!

QuoteAnd when did you slip fileTypeExtension into the mix.  I can't keep up!

April 2015. :)  FileType was close, but not quite right for procedures like this.

- Phil
Title: Re: Adding file extensions with metadata
Post by: galactichull on February 26, 2017, 01:50:29 PM
Excellent.  I'll give this a shot. Thank you!