I am trying to write a simple app to take the content from one,or a few, row(s) and output a text file. I have 2 questions (see below code snippet):
function saveAsTSV3() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = SpreadsheetApp.getActiveSheet();
var range = s.getRange("A53:HY54");
var values = range.getValues();
var text = values.join('\r\n');
regex = new RegExp(',','g');
text = text.replace(regex,'\t');
DriveApp.createFile("A file.tsv", text, MimeType.PLAIN_TEXT);
}
It does create the file and put it in the right folder.
- But, it is filled with commas instead of tab characters.
2. Similarly, I need a line-break character at the end of each row. Presently it puts everything together into one long row.
Anyone know how to do these two things? Any assistance is much appreciated!