csv import wont work with non-windows files as we have hardcoded

$eol = "\n\r"
...
$eols = str_split($eol);

in
function node_export_csv_csv_to_array($string, $seperator = ',', $enclosure = '"', $eol = "\n\r") {

Comments

danielb’s picture

This is by design, but it would be good to try to support it anyway.

What are you saving the files with? I'm trying to figure out what format it is, and how new lines in the values of fields are escaped, etc... ?
Is this a file that was originally exported and then resaved?

danielb’s picture

Status: Active » Postponed (maintainer needs more info)
geek-merlin’s picture

Status: Postponed (maintainer needs more info) » Active

in the unix (and probably mac) world $eol="\r"

we might just use preg_split wit $pattern="\n?\r"

danielb’s picture

Status: Active » Closed (won't fix)

Without an informed response to #1, this is a won't fix

brad.bulger’s picture

Version: 7.x-3.x-dev » 6.x-3.3
Status: Closed (won't fix) » Active

i am hitting this exact problem, trying to import a file created directly by users - ie not an export file. newlines in unix (including modern OS X macs) are "\n" (not "\r"). even just editing a file originally generated by Node Export can potentially change the newlines.

i added these lines to node_export_csv_csv_to_array() and got it to accept my file. there is probably a better way to do this, it sure seems like an already invented wheel but i didn't find anything (yet):

  if (strpos($string, $eol) === false and strpos($string, "\n") !== false) {
    $eol = "\n";
  }
danielb’s picture

Status: Active » Closed (duplicate)

Will backport the new DSV format #1566200: Error on Importing CSV File