CSV import not recognising field delimiter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2018 12:32 PM
I am having a problem importing a CSV file using sys_import.do where it appears that the import process isn't recognising the field delimiter. Instead I'm getting the error message:
data contains 1 columns, expected 4
The strange thing is that if I take the contents of the file and copy them to another file, it uploads without issue. I've done a comparison between the two files and they are identical (used a HEX editor to be absolutely sure!) but one works and the other doesn't.
Unfortunately the one that doesn't work is being created by a PowerShell process reading data from an external source so I can't use the same fix. This process *always* fails with the error above.
Am I missing something obvious or is this going to be some bizarre edge case?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2018 12:48 PM
Why do I always find the solution straight after posting to a forum?!
The issue was PowerShell which was encoding the file as "UCS-2 LE BOM". Once I changed this to "ASCII" (UTF8 also adds BOM, which caused other problems) everything was fine.
That's a day I'll never get back 😞

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2018 05:51 AM
I agree, I encountered the same case with a file from one team. All was identical ! Except the format ...
Easy to miss if you don't know this BOM encoding issue 😉