I'm creating a CSV file using suitescript file.create method. Is there a way to change the delimiter/separator? I'm trying to use pipe(|) instead of comma(,).
I've already tried this
var csvFile = file.create({
name : fileName + '.csv',
contents: stringValue,
folder: ****,
fileType: file.Type.CSV,
isonline: true,
separator: '|'
});
It does not work.
Thanks
If you are trying to handle the data with commas. You could try enclosing the values with double quotes ""
.
var stringValue = '"A,B", B, C, D';
var fileObj = file.create({
name : testcsv.csv',
contents: stringValue,
folder: xxxx,
fileType: file.Type.CSV,
isonline: true
});
It should generate like this: