Nimeshika
11 years agoContributor
Write each query output to new csv sheets
Hello,
I am able to fetch the query results and save to new CSV file using jscript. But I need to save the query results to a new sheet each time in the same CSV File.
This is the current Jscript I have used to write to a CSV file:
function CreatingTextFile(file_name,path)
{
if (aqFile.Create(path+file_name+".csv") == 0)
{
Log.Message("The file "+file_name+".csv is created successfully.");
}
else
{
Log.Error("The file was not created.");
}
}
function WritingToTextFile(file_name,path,data)
{
aqFile.WriteToTextFile(path+file_name+".csv", data+",", aqFile.ctUTF8);
}
I want to modify the above code such that I can write data to The CSV file and in any sheet as required.
Kindly guide me for it.
Thank You in advance,
Regards,
Nimeshika
I am able to fetch the query results and save to new CSV file using jscript. But I need to save the query results to a new sheet each time in the same CSV File.
This is the current Jscript I have used to write to a CSV file:
function CreatingTextFile(file_name,path)
{
if (aqFile.Create(path+file_name+".csv") == 0)
{
Log.Message("The file "+file_name+".csv is created successfully.");
}
else
{
Log.Error("The file was not created.");
}
}
function WritingToTextFile(file_name,path,data)
{
aqFile.WriteToTextFile(path+file_name+".csv", data+",", aqFile.ctUTF8);
}
I want to modify the above code such that I can write data to The CSV file and in any sheet as required.
Kindly guide me for it.
Thank You in advance,
Regards,
Nimeshika