Not able to read integer value in excel | Selenium Forum
M
Posted on 16/10/2015
I am trying to read data 122100024 from excel and print it using method getCellData("Sheet name", "Column name", "row number"); but getting output as 1.22100024E8. Please tell me the solution for this. Please find attached xls_reader file.

[code:26vbj8of]import com.soapuitutorial.util.Xls_Reader;

public class TestExcel {

public static void main(String[] args) {
// TODO Auto-generated method stub

Xls_Reader xls= new Xls_Reader("C:\\test\\TestData1.xlsx");

String data=xls.getCellData("Sheet2", "Test", 2);
System.out.println(data);

}

}[/code:26vbj8of]

M
Replied on 16/10/2015

[quote="qtpselenium.supp0rt@gmail.com":1udvd4ar]to fix this.


when saving any number like "23456765432" in excel put a single quote in the end like this.

[quote:1udvd4ar]'23456765432[/quote:1udvd4ar][/quote:1udvd4ar]

I am getting output now 23456765432' but I want 23456765432. Due to single quote I am getting invalid number error in my framework.Please help.


M
Replied on 16/10/2015

send me screen shot of excel.

how you are doing it?


M
Replied on 16/10/2015

[quote="qtpselenium.supp0rt@gmail.com":3d3c8x7w]send me screen shot of excel.

how you are doing it?[/quote:3d3c8x7w]

Please find attached snap.

Responsive image

M
Replied on 16/10/2015

@Ashish Please help in this.


M
Replied on 17/10/2015

that was my mistake.
do this
[quote:2pbc7utf]
'1221000024[/quote:2pbc7utf]


M
Replied on 18/10/2015

Thanks Ashish, its worked.