Should data export files use CSV or TXT extension?

Should data export files use CSV or TXT extension?

Joseph Rézeau發表於
Number of replies: 1
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片 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

評比平均分數: -
In reply to Joseph Rézeau

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

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
Would it work if the separator for CVS files was just defined in that lang files?