Should data export files use CSV or TXT extension?

Should data export files use CSV or TXT extension?

by Joseph Rézeau -
Number of replies: 1
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi all developers,

In the process of refining the questionnaire 3rd party module, I have come across a minor problem on which I'd like to know developers' views.

At the moment there are various approaches in Moodle modules when exporting data as a CSV (comma separated values) file. The questionnaire module uses:

header("Content-Disposition: attachment; filename=$name.csv");
header("Content-Type: text/comma-separated-values");

I expect this works OK for users with an English version of Excel, which can correctly import a *.csv file. Unfortunately, my French Excel expects comma-separated values to be separated by a semi-colon, not by a comma, which results in incorrect import of files with a CSV extension. It is however possible to import comma separated values files in a French Excel if the extension of the file is *.TXT, by specifying the various parameters upon importing.

Note.- There is no such problem with OpenOffice Calc.

  • Can people using a non-English version of Excel confirm this problem?
  • Is there a Moodle standard/consensus on naming such comma separated values files with a *.csv extension or can/should we use *.txt?

Joseph

Average of ratings: -
In reply to Joseph Rézeau

Re: Should data export files use CSV or TXT extension?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Would it work if the separator for CVS files was just defined in that lang files?