File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes Find column number by StringCellValue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Find column number by StringCellValue" Watch "Find column number by StringCellValue" New topic

Find column number by StringCellValue

jake demus

Joined: Dec 16, 2009
Posts: 2
hi there,
i'm tryin to read just 2 particular columns from an excel sheet and write them to a txt file.
My problem is i have the cellNum hardcoded here (cell.getCellNum()==0) which works but these columns may be in different places depending on the sheet.
The column i'm tryin to find has a StringCellValue of "Rule ID" but i don't want this String to write to the txt file.
Hope i've been sort of clear.
Any help would be greatly appreciated!

Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

Hi Jake and welcome to Javaranch! What library are you using? POI?

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
jake demus

Joined: Dec 16, 2009
Posts: 2
Thanks for the reply.
Ya it's POI.
The sheets were created in Excel 2003.
I agree. Here's the link:
subject: Find column number by StringCellValue
It's not a secret anymore!