| | |
Read Excel Sheet
![]() |
•
•
•
•
Hi all I need to read an Excel sheet using java and I need to know how many columns are there in that excel sheet. Please drop a code snippet to this thread
If you are ready to do something for your self take a look here : http://poi.apache.org/
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
•
•
Join Date: Sep 2008
Posts: 13
Reputation:
Solved Threads: 2
•
•
•
•
Hi all I need to read an Excel sheet using java and I need to know how many columns are there in that excel sheet. Please drop a code snippet to this thread
Java Syntax (Toggle Plain Text)
import java.io.File; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; import jxl.Sheet; import jxl.Workbook; import jxl.read.biff.BiffException; /** * * @author jaka */ public class Jxl1 { public static void main(String args[]) { try { File excelFile = new File("C:\\sample-file.xls"); Workbook wb = Workbook.getWorkbook(excelFile); Sheet sheet = wb.getSheet(1); int column = sheet.getColumns(); int row = sheet.getRows(); System.out.println("Total Columns: " + column); System.out.println("Total Rows: " + row); } catch (IOException ex) { Logger.getLogger(Jxl1.class.getName()).log(Level.SEVERE, null, ex); } catch (BiffException ex) { Logger.getLogger(Jxl1.class.getName()).log(Level.SEVERE, null, ex); } } }
hope will help ..
-jaka
![]() |
Similar Threads
- How to call a excel sheet from perl (Perl)
- Reading hex data from .txt file and display in excel sheet (VB.NET)
- Read Excel Spreadsheet (C++)
- Write Data Into Excel Sheet (Pascal and Delphi)
- saving information to excel sheet using java program (Java)
- Accessing excel sheet in an website using vb.net (ASP.NET)
- Saving excel sheet with few column names present as file name (Visual Basic 4 / 5 / 6)
- Excel Sheet Reading (C++)
- read excel records in asp not refreshing (is the excel file cached) (ASP)
Other Threads in the Java Forum
- Previous Thread: Using Inheritance for card game
- Next Thread: About learning spring,strut,hibernate?
| Thread Tools | Search this Thread |
911 actionlistener addressbook android api append applet application array arrays automation binary blackberry block bluetooth character chat class client code component consumer csv database desktop developmenthelp eclipse error fractal ftp game givemetehcodez graphics gui html ide image integer j2me j2seprojects japplet java javaarraylist javac javaee javaprojects jni jpanel julia lego linked linux list loops mac map method methods mobile netbeans newbie number objects online oriented panel printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server set singleton sms sort sql string swing test textfields threads time title tree tutorial-sample ubuntu update windows working





