-1

Sorry I'm new to this but I'm trying to automatically populate a Google Sheet with data from a spreadsheet which is delivered daily to my Gmail account (primarily because I'd then like to use that as a data source for a Google Data Studio Report...).

I've looked at the following pieces of code already published on Stack Overflow:

Simple script to import gmail csv attachment to google sheets

Import CSV attachment into google sheets

Update Spreadsheet via Email Attachments

In every case I'm getting an output in Google Sheets which opens normally but then adds non alpha numeric symbols in between the numbers in the spreadsheet - e.g.:

https://docs.google.com/spreadsheets/d/1bpeTXotjvT2dvTXiivKLd2q6j0m2QDKgQ9CYcPqxsdE/edit?usp=sharing

https://docs.google.com/spreadsheets/d/1tzuAonz7IpYnyYXagj4YG_cNEG6zx_VWx-M17YJubUg/edit?usp=sharing

https://docs.google.com/spreadsheets/d/1UHmmFgwUP5JnFsoxkf6ZhH-a2PeR_5ZHvPv7jWCtsGU/edit?usp=sharing

https://docs.google.com/spreadsheets/d/1nOzFWhhWuRzQo2nrcaw9-rQiimobubI06TA447rAGis/edit?usp=sharing

Can anyone please advise what I'm doing wrong?

Paul
  • 1
  • 1
  • Welcome to stack please read [how to ask](https://stackoverflow.com/help/how-to-ask) then edit your question and add enough code to show the issue and describe your problems. – Linda Lawton - DaImTo Nov 20 '18 at 12:55

1 Answers1

0

I figured it out: the CSV attachement can be encoded in a wide variety ways. The encoding of the file needs to be entered in between the brackets of etDataAsString().

So in my case this was:

getDataAsString('UTF-16')

Without that I thin it will assume the file encoding is UTF_8 by default.

Paul
  • 1
  • 1