0

I am using the following code to create a google sheets file from data contained in a text file in a shared Google Drive. My issue is the process mistakenly identifies the comma as a thousands separator, whereas it's a decimal separator in my locale. Is there some sort of way to configure the separator to be used? If not, some other way to circumvent the issue? This is all done in order to automate the process of updating google sheets.

function createGoogleSheetsFromTXT(textId,sheetsId) { //ids of files on drive
  let textFile = DriveApp.getFileById(textId);
  let blob = textFile.getBlob();
  let config = {
    mimeType: MimeType.GOOGLE_SHEETS,
  };
  
  let spreadsheet = Drive.Files.update(config,sheetsId, blob,{supportsAllDrives: true});
  return spreadsheet.id;
}
Diobal
  • 1
  • 2
  • 1
    Does this help?https://stackoverflow.com/questions/21467261/how-to-change-google-apps-script-locale – Cooper Jun 23 '22 at 13:00
  • Yes, this helps a ton. It turns out the drive API forces the locale of the user upon the created sheet, so changing my user locale to the correct one solved all issues. – Diobal Jun 23 '22 at 13:29

0 Answers0