Export / Import Using CSV Error

Started by karlshurts, January 20, 2024, 01:25:00 AM

Previous topic - Next topic

karlshurts

Hi,

I'm trying to import exif data from a CSV file into files in a directory of jpeg files. I first exported, then edited the file in notepad, in excel (making certain not to change the format) and I've even tried re-importing after an export without changing anything and I still get this error consistently:

Invalid tag name ' ■S o u r c e F i l e ' in CSV file

I've looked at the CSV file in Notepad and can't see anything odd in the first row.

I've used both PowerShell and standard CMD in admin mode and still get the same result.

I'm using version 12.73 on Win11, with all the updates.

Here are the exact commands I'm typing in:
exiftool -csv -filename -imagesize -caption-abstract "\\AZURE\Shurts 2\Pictures\Family History Work Photos\Neil Funeral Photo Book" >"c:\exif data temp\out.csv"

exiftool -overwrite_original -csv="c:\exif data temp\out.csv" "\\AZURE\Shurts 2\Pictures\Family History Work Photos\Neil Funeral Photo Book"

Does it has something to do with powershell or CMD?

I'm attaching the export as well.

I did this a few years ago with the same process and it worked before...not sure what's going on now.

Thanks,
-Karl

StarGeek

That black square at the beginning is the clue, as well as the space after each letter.

Opening up that file in Notepad++ shows that the encoding is UTF-16.


The square at the beginning is the BOM encoding bytes and each character is taking up two bytes, leading to the space in the name when exiftool reads each byte as a separate character.

Notepad++ would be able to change it to UTF-8 via that menu.  Searching around, I found this SuperUser answer which tells you how to convert the file in PowerSell.  You might also check the Excel save options if there's a way to save in UTF-8.

Ah, I found this post that says ASCII or UTF-8 is needed for an Args file.  I'd assume that it's the same for a CSV file.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

karlshurts

That did the trick!!! UTF-8 was what I needed.

Thank you, Thank you!!