ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Schmidtze on July 24, 2017, 10:52:08 AM

Title: New line characters in CSV output
Post by: Schmidtze on July 24, 2017, 10:52:08 AM
Hi,

I found already this: https://exiftool.org/faq.html#Q21 (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
Title: Re: New line characters in CSV output
Post by: Phil Harvey on July 24, 2017, 11:00:18 AM
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