18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
How to write data to csv file into each cell
Hi I want to write data to csv file. for same row.
I tried with below code.
var $ar = new Array();
$ar[0] = ["hi", "", "one"];
$ar[0] = ["", "he" , ""];
_writeCSVFile($ar, "D:/sample.csv", false, ",");
I am able to write csv file, but $ar[0] = ["hi", "", "one"]; is overridden by $ar[0] = ["", "he" , ""];
I need to have both steps. How to do this can any one let me know.
I wanna work with same row but should not be overridden both should exist.
Thanks in advance -- Santosh.
I tried with below code.
var $ar = new Array();
$ar[0] = ["hi", "", "one"];
$ar[0] = ["", "he" , ""];
_writeCSVFile($ar, "D:/sample.csv", false, ",");
I am able to write csv file, but $ar[0] = ["hi", "", "one"]; is overridden by $ar[0] = ["", "he" , ""];
I need to have both steps. How to do this can any one let me know.
I wanna work with same row but should not be overridden both should exist.
Thanks in advance -- Santosh.
Comments
try
$ar[0] = ["hi", "", "one"];
$ar[0].concat(["", "he" , ""]);
http://www.w3schools.com/jsref/jsref_concat_array.asp
regards
Wormi