Author Topic: Wrong separator  (Read 2036 times)

Hefaistos

  • Newbie
  • *
  • Posts: 5
Wrong separator
« 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 ?

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16687
    • ExifTool Home Page
Re: Wrong separator
« Reply #1 on: November 22, 2015, 11:42:32 AM »
Add quotes around the CSV item if it contains commas or control characters like linefeeds.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Hefaistos

  • Newbie
  • *
  • Posts: 5
Re: Wrong separator
« Reply #2 on: November 22, 2015, 12:08:01 PM »
Thanks

Hefaistos

  • Newbie
  • *
  • Posts: 5
Re: Wrong separator
« Reply #3 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)
« Last Edit: November 22, 2015, 04:05:51 PM by Hefaistos »

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3785
Re: Wrong separator
« Reply #4 on: November 22, 2015, 05:23:13 PM »
This might be an Excel problem rather than an Exiftool problem.

I found this StackOverflow answer 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?
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Hefaistos

  • Newbie
  • *
  • Posts: 5
Re: Wrong separator
« Reply #5 on: November 22, 2015, 05:29:47 PM »
Here is the csv file that i get with the macro

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3785
Re: Wrong separator
« Reply #6 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

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. 
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Hefaistos

  • Newbie
  • *
  • Posts: 5
Re: Wrong separator
« Reply #7 on: November 22, 2015, 06:05:08 PM »
libre office dus the job so to see.
Gonna try it tomorrow good night