I need to insert tab character on place of _ between day and hour.

exiftool -T -r -filename -CreateDate -d "%Y%"."%m%"."%d_%H%"."%M%"."%S" /Users/***/***/testmapa/mapa2/ > /Users/***/***/testmapa/out10.csv

I have tried to insert it in all possible ways with \t, in combination with "",'',& and no collapse. It just wont work for me. Im using osx terminal. Take note that line is in .Command file. Not terminal itself.

Edit; my solution was ## and | perl -pE 's/##/\t/g'

  • 2
    You can try (outside of double quotes) $'\t', or press Ctrl+V followed by the Tab key. (OS X has an older bash than Linuxes, so I'm not entirely sure these will work.)
    – egmont
    Nov 25, 2016 at 18:15
  • I tried that before, it wont work. And I have stated that that line is in .command file, so keyboard shortcuts are not useful.
    – ikiK
    Nov 28, 2016 at 9:48
  • In that case can't you just simply insert a literal Tab character in the file?
    – egmont
    Nov 28, 2016 at 17:16
  • Its not working. Tried that too...
    – ikiK
    Nov 28, 2016 at 17:50
  • my solution was ## and | perl -pE 's/##/\t/g'
    – ikiK
    Nov 30, 2016 at 8:14

1 Answer 1


It is still awkward to enter a tab in Exiftool -p output. I found that using this approach will insert one:

Exiftool -p '$Tag1${Filename;s/.*/\t/}$Tag2' <directory> > outfile.txt

Essentially, ${Filename;s/.*/\t/} takes a "known" valid EXIF Tag (Filename) and substitutes its entire value with just the Tab character, not Filename.

.* - . matches any character. * means match any number of times.

Note: Single quotes ' for Mac; double quotes " for PC.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .