2

Am working with Solspace Importer for the first time in EE2 and I find that I am unable to import .CSV files as entries.

The erorr that get is:

The source data file contained either no data or invalid data.

I've tried a number of increasingly simple .csv files and none of them are working.

I am running EE 2.8.1 (latest) and Solspace Importer 2.2.4 (also latest).

Viewing the expressionengine/cache/importer directory I can see that the files are successfully uploaded.

I am able to import via .XML, but NOT .CSV

1 Answer 1

3

This error had to do with line endings in my CSV file.

Our workflow is to create the entries in Excel 2011 on the Mac and Save As .CSV.

Exporting Excel 2011 to .csv results in a file that is encoded "Western (MacOS Roman)" with line endings "Classic Mac (CR)". Changing line endings to either Unix or Windows style makes it work in Importer. The default encoding is problematic too.

I'd say this is a bug in Importer except for the fact that the RFC specifies CRLF.

I've added a fix for this as a feature request with Solspace.

4
  • 3
    Along with the encoding being wrong Excel is notorious for adding breaking spaces that will break a .csv file. OpenOffice, Numbers, and NeoOffice will all export to a .csv file properly without having to deal with encoding or space issues. Commented Jul 14, 2014 at 23:10
  • Thanks @JustinLong. I bet I've bumped my head on the breaking spaces thing before come to think of it. Our workflow is distributed across a bunch of semi-technical folks so would prefer to allow them to work with that tools they have (sadly this means Excel).
    – AllInOne
    Commented Jul 14, 2014 at 23:25
  • 1
    The frustrating issue about the breaking space is that it appears as a normal space in most text editors so it doesn't look like an issue but it is. You have to open it in Terminal on a Mac to actually see the breaking spaces. Commented Jul 14, 2014 at 23:56
  • What @JustinLong said. Excel is just not very good (read: terrible) at generating standard-compliant CSV files.
    – Solspace
    Commented Jul 15, 2014 at 5:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.