6

I'm importing csv files from Gmail attachments into an existing Google Spreadsheet.

I use the getDataAsString() to hold the entire csv contents. I've tried it varying sizes up to ~6000 characters. Is there a maximum number of characters this string can take?

Craig.Pearce
  • 746
  • 7
  • 25
  • 1
    The limit will probably be the Gmail attachment size rather than the string length.... easy to test though, see the answers in the post linked in the answer below. – Serge insas Sep 27 '14 at 11:23

2 Answers2

3

The limit for strings in Google Apps Script is 67,108,864 (67 million) characters. You can try it yourself with this function:

function strtest() {
  var str = "a";
  while (1) {
    str = str + str;
  }
}

Outputs:

enter image description here

I am not sure if there is a way to increase this through other means (for example, there is a fix for this in Wordpress).

Augustine C
  • 794
  • 6
  • 20
0

GAS is based on Javascript, and apparently there is no JS string variable limit:

javascript object max size limit

Community
  • 1
  • 1
Tim
  • 756
  • 1
  • 7
  • 12