0

I am working on a project where I have to copy data from Sheet1 to Sheet2.

I am able to create new file i.e. file2 and copy the whole data from file1 to file2.

My Requirement # I want to copy specific columns in specific sequence from file1 and paste the same in file2. I am using, ".xlsx" file. Note I have 10,000+ row of data to copy from each column.

In Apache POI I did not find any help with regard to XSSF format to copy specific columns.

Please guide me.

f_puras
  • 2,521
  • 4
  • 33
  • 38
Debamita
  • 1
  • 1
  • I don't think you can copy column, you have to copy row per row needed column. Could you be more precise on what you're trying to achieve, like some example ? – Mateo Barahona Jul 29 '21 at 21:26
  • in POI just iterate through the rows and get the cell at that column's index. – pcalkins Jul 29 '21 at 22:55
  • Thanks. If column copy is not possible then can we delete the whole column after the data has been copied to file2 from file1.Lets take ex-in file1 I have 20 column and 15000 row data and i want to copy specific column data like-Column A;Column D;Coulmn F;Column AC and paste the same in file2, is this possible? Note # I can copy the whole file1 to file2, but my challenge is I cannot delete the columns which i dont need. In addition how do I identify a particular column & row for ex - ColumnARow1 i.e. A1 or ColumnHRow50 i.e. H50 (How can i iterate such activity using POI). Please suggest. – Debamita Jul 30 '21 at 10:08
  • My basic project requirement is to compare two excel files where we need to maintain the following conditions: a. File1 will have 20 column and 10000+ rows and File2 will have column 10 and 9000+ rows. I need to compare both the files, while comparing I know which column matches from file1 vs file2 and that's the reason why i am asking if we can either copy data as its from particular column and paste to another file3 or delete particular column from file3 which is not required. – Debamita Jul 30 '21 at 10:09

1 Answers1

0

Is java need here? Just press on the column to select all included rows, and copy that to your target file.

Emil S
  • 29
  • 4