Hello.
I have a text file with hundreds of lines. Each line is the full path of a file to be processed by this ExifTool command:
exiftool -@ path1\file_list.txt -X -w path2\%d%f.xml
Often, in an input folder, I have files with the same name but not the same extension. Example: test1.jpg and test1.tif.
In these cases, ExifTool processes only one of the files and I get only one xml file as output. Of course, I need one xml file per input file.
What would be the way to reach my goal?
Kind regards.
How do you want to name the duplicate XML files? Obviously, you can't have two XML files with the same name for each of the test1.jpg/test1.tif.
You might change the XML file name to include the extension.
exiftool -@ path1\file_list.txt -X -w path2\%d%f.%e.xml
You could also use a copy number %c instead of the extension %e but then you don't have a way to tell which XML file belongs to the tiff or the jpg.
See the -w (-TextOut) option (https://exiftool.org/exiftool_pod.html#w-EXT-or-FMT--textOut) for details on the percent variables.
Thank you StarGeek!
In case this might be useful to someone. In the command:
exiftool -@ path1\file_list.txt -X -w path2\%d%f%+c.xml
and precisely in "%+c", "+" adds an underscore before the copy number. Output will be: "test1.xml" and "test1_1.xml".
But I think you are right, StarGeek, adding the extension is a good idea.
You are proposing this output: "test1.jpg.xml" and "test1.tif.xml". But I have some superstition that prevents me from putting a dot in filenames except before the extension, of course. Do you have any religion on the subject? Personally, I am used to insert "_" as a separator.
If you don't want 2 dots in teh name, you could do this:
-w path2\%d%f_%e.xml
- Phil
Thank you, Phil.
If you or anyone here would like to comment my superstition of not putting dots in filenames, I would be interested.
Multiple dots in filenames are fairly common nowadays. I haven't had any problems with it, but I'm on a Mac and things may be different for Windows.
- Phil
Thank you again, Phil.
Windows and Linux Users: any comments on the use of dots in filenames are welcome here. Although I admit that it is not an ExifTool issue.