Forums

CSV export delimiter

stycer 11 Feb, 2014
Hi,
another question - it's not my intention to bother the admins.

Is it possible to change the delimiter of the CSV file?
I checked the php code , but couldn't find a solution on my own.

In the edit field of the action, there is no option to change the delimiter asaik.

Best regards,
Stycer

PS: I checked the bug thread here - but it seems , that the solution for CF V4 can't be used with CF V5.
GreyHead 11 Feb, 2014
Hi Stycer,

You can certainly do it in CFv4 but not, as far as I can see, in CFv5 :-( Max is adding features so it may well come in a future release.

Bob
stycer 11 Feb, 2014
Hi Bob,
thanks a lot for your answer.
Just one amendment.
Not even by changing the "csv_export.php" file this is possible?
Isn't somewhere in this file the definition included WHICH delimiter to be used?

Best regards,
Jo
GreyHead 11 Feb, 2014
Hi stycer,

I dug in the code and found this (not tested so tread with care). In /administrator/components/com_chronoforms5/chronoforms/actions/csv_export/csv_export.php at line 100 is this code:
fputcsv($filehandler, $vals); // add parameters if you want
Try changing this to e.g.
fputcsv($filehandler, $vals, ';', '"'); // add parameters if you want
the two new parameters are the separator and the delimiter.

Bob
stycer 11 Feb, 2014
Wow! Yes! Yes! Yes!

It works - great!
Excel is opening the file with ";" delimiter as if it is an excel file:-)
Thanks a lot!

I will try to buy you a beer 😉 - Cheers!

BR from Hamburg/Germany
stycer
This topic is locked and no more replies can be posted.