This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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!