Trouble importing CSV

123 views
Skip to first unread message

Daniel Gijón

unread,
Dec 9, 2019, 3:20:34 PM12/9/19
to AtoM Users
Hi!

I have troubles importing a CSV. When I try to import it, I get the next message:

 Unable to execute INSERT statement. [wrapped: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'source_culture' at row 1]

I tried to find the problem in my CSV, but I can't do it. Everything looks right to me. I send you the CSV.

Thanks!
AFA1.csv

Dan Gillean

unread,
Dec 10, 2019, 10:38:44 AM12/10/19
to ICA-AtoM Users
Hi Daniel, 

Did you create this CSV using Microsoft Excel, by chance? Or else, perhaps you pasted in your data from a Word document or something?

The CSV you have included is not UTF-8 encoded, and it appears to use semi-colons as the column separators, rather than commas as AtoM expects. Because of this, your data is being shifted, and the wrong column is trying to import into the culture, which is restricted in size in the database schema for exactly this reason. 

As noted in our documentation, we strongly advise against using Excel for preparing AtoM import data. Microsoft uses its own character encoding (WinLatin) by default, as well as its own custom line ending characters, which can cause all sorts of issues when imported into AtoM. 

Instead, we recommend you use LibreOffice Calc - not only is it free and open source, it also allows you to configure the character encoding, field separators, and more every time you open a CSV file, so you can ensure you are using the correct settings. When I try to open your CSV with Calc, I can immediately see in the preview provided that the CSV is malformed. If I add support for using semi-colons as the separator, it fixes most of the column issues, but there are still character encoding issues every time an accent appears in your data, which would not be the case if the data was properly UTF8-encoded: 

csv-encoding.png

I think if you fix this issue, it should resolve your problems. 

PS - I'm still hoping to have a developer follow up with you on the other thread about the tools:purge command. Stay tuned! 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/95730fcb-0cb7-4249-986f-fb2eae3d7ef8%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages