It's not a secret anymore!*
The moose likes Java in General and the fly likes Excel File Parser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Excel File Parser" Watch "Excel File Parser" New topic
Author

Excel File Parser

Y Kumar
Greenhorn

Joined: Mar 01, 2009
Posts: 2
Hello people,

I've a particular requirement. I use to get an Excel Worksheet as input, containing UTF-8 encoded data, which i import into Sql Server.
There is a lot of processing done over data in sql I got through excel sheet, like Full-text population.. etc.

The point is , i need to develop a code, that should parse the Excel sheet and validate before any DTS import is done. Validation like.. for a particular column i don't need space in between , or i don't need any numeric character in any column.

One approach can be to convert that sheet into XML file and then parse it, but that will require DTD.

Can anyone help in this regard. Need a speedy solution.

Thank you in advance.

Regards,
Yogesh.


Yogesh Kumar
"I have Hunger for my Dream, hence chasing it "
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41634
    
  55
Welcome to JavaRanch.

The most common libraries to access Excel files are Apache POI and JExcelApi.

I don't understand why a DTD would be needed to process an XML file, but then, I'm not sure in which particular way you'd convert an Excel file into an XML document.


Ping & DNS - my free Android networking tools app
Y Kumar
Greenhorn

Joined: Mar 01, 2009
Posts: 2
Thanks Ulf ,

Excel can be converter to XML from MS Excel only by saving as XML file type.
But I'm not sure about this approach.

As far JExcelAPi is concern i think its to read, write, and modify Excel spreadsheets.
I don't know whether i can validate excel sheet.

Can you provide any sample code regarding this?
Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
JExcel is something which I would suggest for its ease of use, and lightweightedness [compared to POI].
You can do faster validation in your java code itself, than wasting time to convert it to XML.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19685
    
  20

Y Kumar wrote:As far JExcelAPi is concern i think its to read, write, and modify Excel spreadsheets.
I don't know whether i can validate excel sheet.

If you can read the sheet, you can read the contents and validate them manually.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Excel File Parser