• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Copy particular rows in excel using POI

 
Prashanth Chandra
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Prashanth Chandra
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there's an API method for that, either. You'd need to do that one by one as well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic