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") {
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
Comment #1
danielb commentedThis 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?
Comment #2
danielb commentedComment #3
geek-merlinin the unix (and probably mac) world $eol="\r"
we might just use preg_split wit $pattern="\n?\r"
Comment #4
danielb commentedWithout an informed response to #1, this is a won't fix
Comment #5
brad.bulger commentedi 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):
Comment #6
danielb commentedWill backport the new DSV format #1566200: Error on Importing CSV File