ExifTool Forum

ExifTool => Newbies => Topic started by: Hefaistos on November 22, 2015, 08:48:52 AM

Title: Wrong separator
Post by: Hefaistos on November 22, 2015, 08:48:52 AM
An extra carriage return and line in Caption-Abstract is seen as a separator in CSV.
While the comma should be the separation.
How do I avoid this ?
Title: Re: Wrong separator
Post by: Phil Harvey on November 22, 2015, 11:42:32 AM
Add quotes around the CSV item if it contains commas or control characters like linefeeds.

- Phil
Title: Re: Wrong separator
Post by: Hefaistos on November 22, 2015, 12:08:01 PM
Thanks
Title: Re: Wrong separator
Post by: Hefaistos on November 22, 2015, 03:41:55 PM
I have tried a lot with this picture and quotes.
The csv goes wrong with Caption-Abstract
When I  import it in excel the caption is distributed over 2 rows

I use  in a excel macro :
FileArgs = "-csv -f " & Folder & " > " & OutputFile 
Tags = " -Objectname " & "-Caption-Abstract " & "-Headline " & "-Keywords " & "-Category " & "-Credit " & "-DateCreated "
cmd = "cmd /k " & Exiftool & Tags & FileArgs
Call Shell(cmd)
Title: Re: Wrong separator
Post by: StarGeek on November 22, 2015, 05:23:13 PM
This might be an Excel problem rather than an Exiftool problem.

I found this StackOverflow answer (http://stackoverflow.com/questions/2668678/importing-csv-with-line-breaks-in-excel-2007) which has two suggestions.

One person was having problems because the CSV file was not in ASCII or UTF-8.

The other person fixed the problem by just double clicking the file and letting Excel load it automatically rather than using the Open file menu which brought up the Import Wizard.

Can you post an example CSV file?
Title: Re: Wrong separator
Post by: Hefaistos on November 22, 2015, 05:29:47 PM
Here is the csv file that i get with the macro
Title: Re: Wrong separator
Post by: StarGeek on November 22, 2015, 05:49:06 PM
I don't have Excel, but it appears to have loaded into Libre Office correctly.  Your captions load into a single cell even though they have line breaks.

Screen Cap (https://i.imgur.com/lz8wyJX.png)

It seems to me that it is an Excel problem.  For Libre Office, I did have to make sure it that the only separator option was comma. 
Title: Re: Wrong separator
Post by: Hefaistos on November 22, 2015, 06:05:08 PM
libre office dus the job so to see.
Gonna try it tomorrow good night