ExifTool Forum

ExifTool => Newbies => Topic started by: joe shimamura on August 21, 2017, 04:23:35 AM

Title: Help print full path in the output
Post by: joe shimamura on August 21, 2017, 04:23:35 AM
 Hi, I need help to write a full path from my jpg collection direcory in a simple output txt file.

exiftool -T -p $FileName -ext jpg -r C:\test > out.txt

my goal is have this output

C:\test\1.jpg
C:\test\4.jpg.....etc

but at the moment I see only this

1.jpg
4.jpg.....etc

thx
Title: Re: Help print full path in the output
Post by: Phil Harvey on August 21, 2017, 07:27:40 AM
There are a couple of ways to do this:

1. exiftool -p "$directory/$filename" -ext jpg -r DIR

2. exiftool -filepath -s3 -ext jpg -r DIR

The first technique will have paths relative to the current working directory unless DIR is an absolute path name.

The second technique will always generate absolute paths.

- Phil
Title: Re: Help print full path in the output
Post by: joe shimamura on August 21, 2017, 01:03:22 PM
Thx, but I would like to have backslash in the path, how can I do it? :)
Title: Re: Help print full path in the output
Post by: StarGeek on August 21, 2017, 11:27:42 PM
You could add -api "Filter=s/\//\\/g" to your command, but that will replace every slash in the all the output with backslashes.

Using the -p option, you could use -p "${filepath;s/\//\\/g}".