Welcome, Guest
Username: Password: Remember me

TOPIC: Row separator in csv file

Row separator in csv file 2 years 9 months ago #62632

  • waitz
  • waitz's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 170
  • Thank you received: 1
  • Karma: 3
I have to change the separator in exportresults.php from comma to another character, but the rows in the csv file don't have a separator.

How can I add a row separator in exportresults.php to the csv file?

I changed the separator in line 295:
case "csv":
        header("Content-Disposition: attachment; filename=results-survey".$surveyid.".csv");
        header("Content-type: text/comma-separated-values; charset=UTF-8");
        $separator="~|";
        break;
Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
Last Edit: 2 years 9 months ago by waitz.
The administrator has disabled public write access.

Re: Row separator in csv file 2 years 9 months ago #62653

  • waitz
  • waitz's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 170
  • Thank you received: 1
  • Karma: 3
Hmmm, it looks like it creates a row separator: \n

But this separator is also created when someone presses enter in a text area, which creates a mess.

Where can I change the separator character for the rows in the csv file (only)?
Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.131 seconds
Donation Image