| Author |
How to get column index number based on cell value of a excel sheet
|
Raaja Gotluru
Ranch Hand
Joined: Mar 02, 2010
Posts: 84
|
|
Hi,
I am having an different excel sheets with first row as the header. In that one column header is "email".
I want to know the email address in that column basing on the column index while iterating through rows. I dont want the rest of the column values.
How to acieve this guide me.
Thanks.
--raaja. g
|
 |
Jon Avadis
Ranch Hand
Joined: Jul 20, 2011
Posts: 49
|
|
To handle Excel files, the easiest way is to use an API like JXL (->google).
Then you can iterate through the cells of the first row until you get the cell-content "email" (the header of the column your looking for).
Now you know what column number your email adresses are stored in and you can iterate through the cells of that column and read
out all the email-adresses.
You could do it without an external library if you convert the Excelfile to a CSV first, and then read the file with a Scanner or whatever you
prefer.
|
Knowledge Reigns Supreme
|
 |
 |
|
|
subject: How to get column index number based on cell value of a excel sheet
|
|
|