- 🇦🇺Australia SL200
Even in 2023, Microsoft Excel creates a csv file in the wrong "UTF-8" format.
It gives the confusing error: "Your CSV has missing required fields: name"
Follow the instructions in comment #6 to change the file format from "UTF-8 BOM" to "UTF-8" and the import will work correctly.
- First commit to issue fork.
- 🇩🇰Denmark ressa Copenhagen
Maybe the tip from #6 about changing format from "UTF-8 BOM" to "UTF-8" could get included in the README, since it sounds like it solves the problem for some?
@SL200: I created a fork, and if you have Gitlab access, you should be able to edit the README and create a merge request.
- @sl200 opened merge request.
- 🇦🇺Australia SL200
@ressa, Thank you for your comment. I have edited the README and created a merge request as you suggested, but this won't help most people as they won't see the README as they don't look at the module's code.
The comment should be added to the Module page but I can't see any way to do that. The relevant issue could then be closed. - 🇩🇰Denmark ressa Copenhagen
Perfect, thanks @SL200! You might want to limit the line length max. 80 characters, if possible?
I do look at the README.md for further information on modules, and I know many others do to.
But perhaps we can add it under https://www.drupal.org/docs/contributed-modules/csv-importer/ → as well? I created this page, perhaps the admin can publish it, and place it at the top:
https://www.drupal.org/docs/contributed-modules/csv-importer/overview-of... →
- 🇦🇺Australia SL200
@ressa thanks again. I did actually keep the lines shorter than the existing lines in the file, but I didn't think to realise that they were hyperlinks so they weren't actually part of the printed characters in the line. I have shortened the lines so they are all less than 60 characters and saved it. If I have missed something then I have no problem if you or someone else wants to fix it, as I'm a noob with the process.
Fully agree that a comment should appear on that module page and if possible on https://www.drupal.org/project/csv_importer → as well. I want this module to be successful and not have people give up like I almost did because of an unknown technicality with variants of UTF8 encoding.
---------------------------------------------------------------------------------------------
P.S. If anyone using this module has trouble with only the first digit or 2 of a long number importing into a numeric field, especially if you are using Excel to prepare your csv file - you need to remove the commas from any numbers (i.e. uncheck the commas option in the number format). Even though they are delimited with double quotes, the importer doesn't recognise commas in a number and stops when it finds one. - 🇩🇰Denmark ressa Copenhagen
No problem @SL200, there are a lot of recommendations and rules to learn here on drupal.org :)
The only reason I commented about the 80 characters per line is that some tests check for that, so that would cause an extra alert about "Line exceeds 80 characters". Personally, I don't think that the 80-characters-per-line rule make sense in README.md's, for example.
You can check these pages out, where that rule is mentioned a few times:
- 🇨🇦Canada rustyco
I dunno if this will help, but I received an Excel spreadsheet which I saved as .CSV. A 'required' field in my content type reported "Your CSV has missing required fields:". The problem was a space after the heading name ('field_order_form ', a required field). If the space comes after a non-required field name, it just doesn't upload the data. The spaces aren't easy to see, and they didn't matter to the visibility in the original Excel sheet.
In our case, the problem was solved by selecting the "Field name" option instead of "Label" for the Header (for all fields).