How can I get data from data sheet as a by row number

I have data sheet and I need to read data for the data sheet by row wise
as example
Information Security Refresher: Malicious Links S.17
So the code need to be select country and get the data based on selected country.

please give me a suggestion.

@kshaharier A suggestion would be to open a link to the Excel sheet and then read in the “select country”, then loop through the data “based on selected country”.

FileInputStream fis = new FileInputStream (GlobalVariable.gPathWay);
XSSFWorkbook workbook = new XSSFWorkbook (fis);

XSSFSheet sheet = workbook.getSheet(“Sheet1”);
‘Loop will execute for all the rows of the table’
for (int crow = 0; crow < country_count; crow++)
// cell A2
Row row = sheet.getRow(1);
Cell cell = row.getCell(0);
countryPart = cell.getStringCellValue();

for (int row = 0; row < data_count; row++)
// cell A3
row = sheet.getRow(2);
cell = row.getCell(0);
dataPart = cell.getStringCellValue();

… do something with dataPart or countryPart


Hi @kshaharier,

You can refer to this…

Hope that helps. . . :slight_smile: