wood burning stoves 2.0*
The moose likes Other JSE/JEE APIs and the fly likes Copy particular rows in excel using POI 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 » Other JSE/JEE APIs
Bookmark "Copy particular rows in excel using POI" Watch "Copy particular rows in excel using POI" New topic
Author

Copy particular rows in excel using POI

Prashanth Chandra
Ranch Hand

Joined: Dec 07, 2005
Posts: 79
Hi,
I have two excel files and i have to compare two columns in the both the excel files and get the matching data from the first sheet. I am able to compare the two sheets and get the common data. I have the exact row numbers which are common in both the excel files.
Can someone help me as to how I can pick the exact rows from the excel sheet using POI. I will be passing the row number and need to retreive the whole row and copy in a new sheet.

regards
Prashanth







regards
Prashanth
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41626
    
  55
I don't think there's anything in the POI API to do exactly this. You'll have to iterate through the rows and cells of the sheet one by one and perform the comparison in code of your own.


Ping & DNS - my free Android networking tools app
Prashanth Chandra
Ranch Hand

Joined: Dec 07, 2005
Posts: 79
Hi,
I have done the comparision using normal java code. I just need to know as to how I can copy a particular row from one sheet to another. As I have the matching rows, i just need to copy the rows to a new sheet.


regards
Prashanth
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41626
    
  55
I don't think there's an API method for that, either. You'd need to do that one by one as well.
 
Don't get me started about those stupid light bulbs.
 
subject: Copy particular rows in excel using POI