Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
r.allard

Change CSV export separator

Hello,

I would like to use the CSV export function so that my client can open his data in Excel.

The problem is that Excel (in its French version) only opens by default CSVs separated by semicolons and encoded in Windows-1252 or ISO.

Is it possible to change the separator and encoding with a hook? That would help me a lot!

Thank you !

4 years, 12 months ago
Stefan van den Dungen Gronovius
Developer

The CSV file is exported as UTF and can be imported in Excel by using the import feature
https://excel.officetuts.net/en/examples/how-to-import-csv-file-that-uses-utf-8-encoding

It is not possible to change the encoding, but it is possible to change the delimiter by using the following hook
ac/export/exporter_csv/delimiter

add_filter( 'ac/export/exporter_csv/delimiter', function( $delimiter ){
  return $delimiter;
},10,1);

Let me know if you have any further questions.

4 years, 11 months ago

You must be logged in to reply to this topic.