Utilities.parseCsv() 'Could not parse text' (Google Apps Script)

后端 未结 3 2081
情书的邮戳
情书的邮戳 2021-01-07 03:32

I\'m really confused because this was working earlier and I don\'t know why it is broken now. I\'ve got CSV files that I\'m trying to parse. I\'m accessing them using the fo

3条回答
  •  遥遥无期
    2021-01-07 04:00

    I was dealing with the same problem today and discovered that trailing spaces at the end of some lines were causing the parser to fail. I resolved this with this regular expression: csvString.replace(/[ \t]+$/gm, '')

提交回复
热议问题