I am exporting data from magento which needs to be imported on another system. The magento installation is running on Unix, but the import is happening on windows.
So the csv is created on unix so the line breaks are just hex 0a
, where as Windows expects them to be 0d 0a
, I believe. If it's opened in wordpad then saved, then it's fine.
--- EDIT ---
This is what I'm doing to add lines to my csv:
fwrite($handle, '"'.implode('","', $productdata).'"'."\r\n");
Adding each field to the array and at the write I just implode the array on closing quotes and a comma and add \r\n
onto the end.
From the limited amount I've read about it, it appears Unix/Mac parse CRLF as 0a
while windows parses it as 0d 0a
. Maybe I'm not quite hitting the nail on the head, regardless, the issue remains.
Is there any way I can force line breaks to be parsed as the hex that windows is looking for, or anyway I can manually add the hex?