Blog Archives

Read Excel file in Java using POI API


import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.Iterator; public class ReadExcelFileUsingPOI{     public static void main(String[] args) throws Exception {         String filename = “D:\\test.xls”;         FileInputStream fis = null;         try {             fis = new FileInputStream(filename);             HSSFWorkbook workbook = new HSSFWorkbook(fis);             HSSFSheet sheet = workbook.getSheetAt(0);             Iterator rows = sheet.rowIterator();             while (rows.hasNext()) {                 HSSFRow row = (HSSFRow) rows.next();                 Iterator cells

Tagged with: , , , , ,
Posted in JAVA, POI API

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 678 other followers

Calendar
July 2018
M T W T F S S
« Mar    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
Mallikarjun Gunda

This is Mallikarjun Gunda, I am working as a software professional. Blogging is my Passion. This blog contains the posts on Java related technologies and programming languages. I am happy to share my knowledge through the blogs.

Blog Stats
  • 265,562 hits
IndiBlogger
malliktalksjava.wordpress.c...
70/100