| | |
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 |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card class classes client code collision columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal free game givemetehcodez graphics gui guidancer html ide image inetaddress integer integration intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods migrate mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle plazmic print problem program programming project radio recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree unlimited utility webservices windows





