Help print full path in the output

Started by joe shimamura, August 21, 2017, 04:23:35 AM

Previous topic - Next topic

joe shimamura

 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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

joe shimamura

Thx, but I would like to have backslash in the path, how can I do it? :)

StarGeek

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}".
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype