0

My goal is to export a CSV from google sheets using encoding UTF-16.

Google sheets is by default exporting CSV in UTF-8 and uses commas to separate values.

I would like to export the CSV in UTF-16 (more precisely UTF-16-LE).

How can I do that directly from google without having to convert the exported file into another encoding? (using a text editor or something else)

Bonus: how to export with a custom the separator? (I would like to use TAB instead of commas)

0

1 Answer 1

0

Assuming that you are comfortable doing this in Google Apps Script, see this answer and Utilities.parseCsv.

Once you have the data in a 2D array, you can get it in a tab-delimited format with this pattern:

const tabSeparatedValues = my2dArray.map(row => row.join('\t')).join('\n');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.