Metadata to CSV: Adding ' Instead of Using -n Parameter

Started by AliGW, February 27, 2023, 10:41:17 AM

Previous topic - Next topic

AliGW

SOLVED

Hello!

Brand new here, so not sure what terminology to use to search for this. I hope someone can advise.

I am using this command:

>exiftool -FileName -Model -FNumber -ISO -ExposureCompensation -FocalLength -Extender -AELock -MeteringMode -LensModel -Aperture -ShutterSpeed -T -n -csv -ext ORF DIR1 > DIR2
This works fine, except that the shutter speed is, of course, turned into a decimal. Is there any way to tell ExifTool to add a ' (apostrophe) in front of the shutter speed tag instead of the -n parameter so that the .csv file opens in Excel with the shutter speeds properly represented (e.g. 1/200) instead of Excel converting them to dates?

I really hope this is possible.

Thank you for your help!

StarGeek

My first suggestion is to use the -n (--printConv) option only on the tags where you need the raw values.  This can be done with the # version mentioned in the docs on that option.

C:\>exiftool -G1 -a -s -ShutterSpeed -ShutterSpeed# Y:\!temp\NEF_Test\2017-07-22_21.34.12.Nef
[Composite]     ShutterSpeed                    : 1/160
[Composite]     ShutterSpeed                    : 0.00625

But then, I don't know how Exec will react to a value of "1/160".

I believe the only other option would be to create you're own CSV format using the -p (-printFormat) option.  But, depending upon the command line you're using, you may have to use a FMTFILE text file to include the tabs.  Windows doesn't let you put a tab on the command line, but I don't know about others.

Your FMTFILE file could be something like this, using # only on the tags where you need the raw values
$FileName $Model $FNumber $ISO $ExposureCompensation $FocalLength $Extender $AELock $MeteringMode $LensModel $Aperture '$ShutterSpeed'
And your command would be
exiftool -p /path/to/FMTFILE.txt -ext ORF DIR1 >file.csv
"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

StarGeek

Just realizing, I don't think the -T (-table) option is compatible with the -csv option.  So I don't know if you want tab separators or comma separators.

You might also read FAQ #12 for other options.
"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

AliGW

Thanks so much for the advice! I will give what you suggest a try tomorrow.

I read somewhere that the -T paramenter forces the data into tabular format and it works fine with my command line - the .csv is created as expected.

Could you clarify this?

QuoteYour FMTFILE file could be something like this, using # only on the tags where you need the raw values

Where does the hashtag need to go in the code snippet?

AliGW

Thanks again. I have just worked out how to convert the decimals into fractions in Excel, so I don't need this any longer. For anyone who is interested:

="1/"&ROUNDUP(1/M2,0)

where M2 contains a decimal shutter speed.

Thank you again for your time.