I have an excelsheet in which I have data something like this ,my requirement is to read the excelsheet and get the screen_name having type dropdown , this is my sample input and I have also added output which can be used as a refrence
Seq Screen_name Type
1.0 ds_top dropdown
2.0 ds_level detail
output for this will be :- ds_top
I was able to read the excelfile and get the column values of screen_names and type seperately but how to implement further logic
Any Help is appreciated
import java.io.FileInputStream;
import java.io.IOException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class ReadCellExample {
String xlsxFile = "/home/spec.xlsx";
public static void main(String[] args) throws IOException {
ReadCellExample rc = new ReadCellExample();
rc.ReadCellData(1, 1, 2);
}
public void ReadCellData(int vRow, int vColumn, int columndef) throws IOException {
String value = null;
Workbook wbook = null;
FileInputStream fis = new FileInputStream(xlsxFile);
wbook = new XSSFWorkbook(fis);
Sheet sheet = wbook.getSheetAt(0);
Row row = sheet.getRow(vRow);
for (int rowIndex = 0; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
row = sheet.getRow(rowIndex);
Cell cell = row.getCell(vColumn);
value = cell.getStringCellValue();
}
for (int rowIndex = 0; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
row = sheet.getRow(rowIndex);
Cell cell = row.getCell(columndef);
value = cell.getStringCellValue();
}
}
}