ExifTool Forum

ExifTool => Newbies => Topic started by: suninmoon on April 21, 2023, 06:12:31 PM

Title: Automation?
Post by: suninmoon on April 21, 2023, 06:12:31 PM
Hi all

You've all helped me with adding GPS and correcting the dates of my video files and I'm thankful for that. Before I start working on hundreds of files is there a way to automate any of this? Like for example if I had 50 files that had the same GPS location could I somehow correct it on them in one command?

Thanks much
Title: Re: Automation?
Post by: StarGeek on April 21, 2023, 07:25:21 PM
Quote from: suninmoon on April 21, 2023, 06:12:31 PMLike for example if I had 50 files that had the same GPS location could I somehow correct it on them in one command?

If they are all in the same directory, then you can just pass the directory to exiftool.

If you have a text file which lists all the files you want to process, then you can pass that text file with the -@ (Argfile) option (https://exiftool.org/exiftool_pod.html#ARGFILE), e.g. -@ /path/to/file.txt

It all depends on how you have them set up.  You can mix and match directories and individual file names in a exiftool command, up to the maximum length of the command line.  Under Windows, the max length is about 8,000 characters, but Linux has a length of over 100,000 characters.
Title: Re: Automation?
Post by: suninmoon on April 22, 2023, 11:21:41 AM
ok so instead of having the file path at the end I just put the directory and it should apply to everything in there?

Thanks
Title: Re: Automation?
Post by: StarGeek on April 22, 2023, 12:33:39 PM
Everything in that directory but not subdirectories unless you add the -r (-recurse) option (https://exiftool.org/exiftool_pod.html#r-.--recurse).  Also, you can't use wildcards such as *.jpg while recursing, you have to use the -ext (-extension) option (https://exiftool.org/exiftool_pod.html#ext-EXT---ext-EXT--extension), e.g. -ext jpg. See Common Mistake #2 (https://exiftool.org/mistakes.html#M2).
Title: Re: Automation?
Post by: suninmoon on April 23, 2023, 04:47:48 PM
Thank you, that worked great! I was able to update the GPS on 72 files at once. If only there were a way to update the date and time as easily but I guess that would require a script to match the date with the filename.