Module 8 Exercise - Print values of each row and column | Selenium Forum
D
Dheeraj Vazirani Posted on 02/08/2020

package sel.train;

public class XlsReading {

public static void main(String[] args)
{

String path = System.getProperty("user.dir")+"//Data.xlsx";
Xls_Reader xls =new Xls_Reader(path);

int cols = xls.getColumnCount("CartTest");
int rows = xls.getRowCount("CartTest");

for(int i = 0; i <= cols; i++)
{

for (int j = 1; j <= rows; j++)
{
String Celldat = xls.getCellData("CartTest",i,j);
System.out.println(Celldat);

}

}

}
}


A
Ashish Thakur Replied on 02/08/2020

Yes thats correct

Are you facing some issue?


D
Dheeraj Vazirani Replied on 12/08/2020

No issues, I just wanted to post the answer to your assignment in module 8, also i did it later on with do while loop for column(outer loop) then iterated thru different rows (using for loop) and it gave a table like structure which was much more easier to read.


A
Ashish Thakur Replied on 14/08/2020

ok


Related Posts