I have a file URL in the following format:
http://.../exchangerate.txt
I cannot use IMPORTDATA because the file is in encoding:
UTF-16
it gives me bad data:
�n�u�l�l�
How to resolve this?
I have a file URL in the following format:
http://.../exchangerate.txt
I cannot use IMPORTDATA because the file is in encoding:
UTF-16
it gives me bad data:
�n�u�l�l�
How to resolve this?
Please try the script:
function importwithencoding(url, encoding, delim) {
if (delim === "tab") { delim = '\t'; }
var data = UrlFetchApp.fetch(url);
var csv = data.getContentText(encoding);
return Utilities.parseCsv(csv, delim);
}
Use it as a custom formula in a sheet:
=importwithencoding("http://.../exchangerate.txt", "UTF-16", "tab")