SHIFT-JIS saves the local CSV file, so it gets garbled when you import it into Google spreadsheet.
I would like to add a code to the following GAS script that you told me in the related question I asked you before, and would it be possible to do so?
function showDialog(){
varhtml=HtmlService.createHtmlOutputFromFile('dialog');
SpreadsheetApp.getUi().showModalDialog(html, "CSV Upload";
}
function uploadCsv(form){
var blob=form.myFile;
varcsvText=blob.getDataAsString();
values = Utilities.parseCsv(csvText);
SpreadsheetApp.getActiveSheet().getRange(1,1, values.length, values[0].length).setValues(values);
}
It would be very helpful if anyone knows.
Thank you for your cooperation.
All I had to do was set shift-jis for getDataAsString...
I was able to confirm the operation with the following code.
We have disabled Apps Script runtime.
function uploadCsv(form){
var blob=form.myFile;
varcsvText=blob.getDataAsString('shift-jis');
values = Utilities.parseCsv(csvText);
SpreadsheetApp.getActiveSheet().getRange(1,1, values.length, values[0].length).setValues(values);
}
© 2024 OneMinuteCode. All rights reserved.