Data contains 1 columns, expected 27

cloudyrobert
Kilo Guru

I'm doing a data import from a CSV file on an FTP server.   The CSV is delimited using semicolons rather than commas, but is not otherwise out of the ordinary.   When I load the file, I get an error, "data contains 1 columns, expected 27".   The transforms run as they should, and the data comes into the system.   Why am I getting this error?

1 ACCEPTED SOLUTION

Maybe try cutting that last row off and see if the error stops.   If it does, just ignore the error.


View solution in original post

13 REPLIES 13

Michael Kaufman
Giga Guru

It is likely one of the date fields in the CSV file causing this issue.



https://community.servicenow.com/thread/175386


https://community.servicenow.com/message/697651#697651



I would try importing some of the data without dates and see if the error goes away.   If that works, you know it is the dates causing the issue. Then can fix that be adjusting the Date Format in the CSV file or the Transform Map.



If it isn't dates, I have also seen this error due to the encoding on the file.   Might have to use different encoding on the CSV file.



Mike


Took out all of the dates and dropped it down to only nine records' worth of data, still got the error.



I'm not sure I'll be able to do anything about the encoding as it is coming from an external source.   Any thoughts on whether it would be a problem to live with the error?   I hate to do that, but it is still functioning as it should, so far as I can tell.


cloudyrobert
Kilo Guru

Couple of things to add...   there is no file extension ".csv" or otherwise.   I have no control over this.   Also, the file has a final line with only the content "# Script execution OK".   I'm thinking this could be causing the issue?   The row has only one column's worth of data and is not an actual valid row...


Maybe try cutting that last row off and see if the error stops.   If it does, just ignore the error.