CSV Import - Multiple Fields

By davidayates - April 15, 2014 - edited: April 15, 2014

How can we import a CSV file with empty fields?

What's currently happening is the import software takes the below sample row:

0001,Title,Description,,Item,,,Item

...and shifts the data to remove the empty fields, which places fields into the wrong column, ie:

0001,Title,Description,Item,Item

Thanks for any help

By Chris - April 16, 2014

It looks like there are at least two PHP bugs related to this issue. For future reference, they're

https://bugs.php.net/bug.php?id=46463

https://bugs.php.net/bug.php?id=55674

What version of PHP are you using? You can find this in CMS Builder in Admin > General Settings > Server Info > PHP Version.

I'll see if I can download the same version of PHP as you're running and try to come up with a fix for you.

All the best,
Chris

Thanks, Chris - I can't tell you how much time that would save, as we're haveing to import data a column at a time.

PHP Version 5.4.26

By Chris - April 16, 2014

Another workaround you might try is opening the CSV file in a spreadsheet program (such as Excel or Calc) and then exporting it as a CSV — it's possible that the program will (a) properly import the CSV file and (b) export the CSV in a format that CSV Import can read.

All the best,
Chris

Thanks for the tips. We tried both single anddouble quotation marks and just "null", ie:

,'', or ,"", or ,null,

And unfortunately, CSV used the various text as entries in the fields rather than leave them null. Maybe CSV Import needs a tweak where if it detects an empty field, it uses "null" for the MySQL insert/update?