I have a google script to extract CSV files from sub labels in gmail. it works beautifully except that if there is anything in the "notes" column, it wraps it down to the next line and adds in extra cells, see the image on line 183.
I have tried using sheet.deleteColumn(11) but it only deletes what is in that cell, not what it sends to the next row. The notes column is automatically added to the CSV file before it comes to my inbox, so there's not much i can do to get it off of there. I included the script.
function import_TS_CSV_from_Gmail() {
var threads = GmailApp.getUserLabelByName('VZ CKID G Script').getThreads();
var first_thread = threads[0].getMessages()
var last_thread = threads[threads.length - 1].getMessages();
var last_thread_last_message = last_thread[last_thread.length - 1];
var attachment = last_thread_last_message.getAttachments()[0];
var sheet = SpreadsheetApp.openById('1ApVkvybqi0j1ItZbjhRly_7sAOvd-FKKw0BwPmRxaOg').getSheetByName('Data');
var csvData = Utilities.parseCsv(attachment.getDataAsString(), ",");
sheet.clearContents().clearFormats();
sheet.getRange(1, 1, csvData.length, csvData[0].length).setValues(csvData);
}