Forums

CSV Export v2 [GH] - CRLF at the end of each line

usu 19 Sep, 2014
Hi,

i'am using Chronoforms V4 with Joomla 3.3.3 and i need to export a csv file with "CRLF" at the end of each line to import the data on a Windows machine. The csv files exported with the CSV Export v2 [GH] action have only a "LF" at the end of each line.

How can i change the CSV Export v2 [GH] action to achieve the "CRLF" at the end of each line?


Thanks for the help and best regards,
Markus
GreyHead 19 Sep, 2014
Hi markus,

What are you trying to import the data into? I use Windows and haven't seen this problem.

Bob
usu 19 Sep, 2014
Hi Bob,

the csv should be used as data interface to a job management software running on windows. The only information that I have is that it was not possible to import the file, because there is only a "LF" at the end of each line. When I open the csv with Windows Notepad then all the data is shown in one line. Notepad++ is "intelligent" enough to show the data correctly in multiple lines and here I can also see that there is only a "LF" at each line.

Is there a way to change this?


Thanks
Markus
GreyHead 20 Sep, 2014
Hi Markus,

I had a look around and can see that this is potentially a problem. I can probably modify the action but it isn't a two-minute job as the PHP fputcsv() function doesn't directly support a line-ending option.

I've seen some suggestions that the way you download may make a difference; also it must be possible, as a workaround, to open the file in a text editor and re-save with changed line endings.

Bob
usu 22 Sep, 2014
Hi Bob,

I did some research myself and came across a workaround which works for me. I installed "dos2unix" on my server and execute it on my csv file. Quite a simple solution but probably not to everyone, because you need to have root access on your server.

Perhaps you could add a feature to select line endings in future versions of the csv export action. I like Chronoforms, it's very powerful!

Best regards
Markus
This topic is locked and no more replies can be posted.