18 January 2026:


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

santosh.kandesantosh.kande Members
edited November -1 in Sahi - Open Source
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.

Comments

  • globalwormingglobalworming Moderators
    Hi

    try
    $ar[0] = ["hi", "", "one"];
    $ar[0].concat(["", "he" , ""]);

    http://www.w3schools.com/jsref/jsref_concat_array.asp

    regards
    Wormi
  • rajivrajiv Members
    edited June 2012
    I have an issue regarding writeCSVfile, i am trying to write an array into file but it not working ,i am trying to store the large set of data and then i am trying to write into the CSV file,either arry is not holding the set of data or if we try to write after each iteration it duplicating the data into csv file
Sign In or Register to comment.