I've downloaded a year's worth of .CSV files from my portal with American Express. I want to use Google Apps script to take this data and put it into Google BigQuery. Can't really do this interactively because the BigQuery UX doesn't provide a mechanism to appending data to a table. So, I have written a script to do it:
var firstFileData = firstFile.getBlob().setContentType('application/octet-stream')
var firstFileDataString = firstFileData.getDataAsString()
var firstFileDataCSV = Utilities.parseCsv(firstFileDataString)
The variable firstFileDataString ends up with the contents of the CSV, but what I'm noticing is that the newline character does not exist. Therefore, logic further down in the program sees many columns instead of the desired 3. Some of the reading that I've done suggests that the contemporary ways for creating .CSV files do not use the newline character \n, favoring the carriage return \r instead.
Implementing a RegExp to look for (and replace) the carriage return also doesn't seem to work around the issue.