Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Excel parsing in Java

 
Krishan Chauhan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am using Apache POI event model with record awareness for parsing Microsoft Excel file. I am able to successfully parse the contents but i am facing problem in validating it. i don't care about the actual data present but want to validate some basic things like number of columns present in each row. Could any one suggest how to do it?


Thanks in Advance.
 
Kuladip Yadav
Ranch Hand
Posts: 162
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

number of columns present in each row


You can iterate over excel row using HSSFRow 's cellIterator method . from that you can estimate number of column
for each row .
Check this API Link
[ September 10, 2008: Message edited by: Kuldeep Yadav ]
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly do you mean by "parsing" and "validating"? POI can read and write XLS files, and provides access to cell contents; no more, no less. if you want certain cells to have certain contents (or rule out certain other contents) you will have to write code to check that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic