New line characters in CSV output

Started by Schmidtze, July 24, 2017, 10:52:08 AM

Previous topic - Next topic

Schmidtze

Hi,

I found already this: https://exiftool.org/faq.html#Q21 But I think it isn't an answer to my problem: I have a command like this

exiftool.exe -csv -all

If a field, for example UserComment, contains multiline data, the CSV output also contains these line breaks. I know, the result is ok by specification, the field value is quoted, so the CSV is valid. But: Unfortunately I didn't find a CSV parser by now which handles it in the programming language I use for pasing the CSV output (Delphi). Is there maybe a way to say ExifTool to replace the newlines by something else?

Many thanks in advance and best regards
Friedemann

Phil Harvey

Hi Friedmann,

First, the -all should not be necessary because extracting all tags is the default.

The filtering of newlines may be done with the api filter option.  Something like this to replace newlines with spaces:

exiftool -api filter="s/\n/ /g" ...

- 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 ($).