Skip to main content

Posts

Showing posts with the label java solution

How To Read Excel and Text File In Java Code

How To Read Excel and Text File In Java Code Read Excel file in java Excel is the very popular file format created by Microsoft.  In this article i have discussing how to read Excel files using java code . Java Code :   public static void main(String[] args) throws IOException  {         String fileName = "C:\\file-path\\report.xls";         String cellContent = "Total";         int rownr=0, colnr = 10;         InputStream input = new FileInputStream(fileName);         HSSFWorkbook wb = new HSSFWorkbook(input);         HSSFSheet sheet = wb.getSheetAt(0);         rownr = findRow(sheet, cellContent);         finish(); } private static int findRow(HSSFShe...