I have a API which sends response in Text format as follows:
"521942","556463745.63","11/1/2016 12:00:00 AM","0","11/1/2016 12:00:00 AM"
"521942","17848781.34","11/1/2016 12:00:00 AM","0","5/23/2016 12:00:00 AM"
"521942","8038249.48","11/1/2016 12:00:00 AM","0","5/18/2015 12:00:00 AM"
I need to export this response into a CSV file but I am not able to do so. I tried using the File Object Method:
var filename = "abc";
var outFilePath = 'C:\\Users\\archit.goyal\\Downloads\\' + filename + '.csv';
var jsonObject = xml2Json(responseBody);
var file = new File({writetofile: new File(outFilePath).write(ReportCSV)});
But this method is throwing error:
There was an error in evaluating the test script: ReferenceError: File is not defined
Please take a look into this issue and suggest.