Re: How to edit excel file with large data using SXSSF change cell color

Andreas Reichel <[email protected]>
Newsgroups gmane.comp.jakarta.poi.user
Message-ID <6b19f2afb7d51ab640496bbdabc92177dfa04c76.camel@manticore-projects.com>
Greetings,

in general 40'000 rows is a very small volume of data and I would not
like to suggest employing Streaming in that case.
Instead, you can hold 40'000 rows in a XSSF workbook easily if you just
provide enough memory. Using a XSSF workbook, you can modify the
content directly as you have tried.

However, if you work with really large data of 1 Mill. rows and many
columns, then the following approach will help:

1) engange the Excel Streaming Reader
2) read both files F1 and F2 simultaneously and compare row by row and
cell by cell
3) based on the found difference, create a new row with new cells and
write that to your result file F3

You can not modify existing cells in a SXSSFWorkbook.

Best regards
Andreas

On Thu, 2020-02-20 at 14:01 -0700, amishad02 wrote:
> I have read all previous ask question but there is no solution I found.
> I need to modify excel file with large data over 40,000 rows. 
> Steps done in below code. 
> Create new file for Result 
> Copy file 2 for result to highlight not equal cell
> Create Workbook for 2 compare excel files
> Temp XSSFWorkbook 
> XSSF cellStyleRed as  SXSSFWorkbook cannot have cellstyle  color
> keep 100 rows in memory, exceeding rows will be flushed to disk
> compareTwoRows from both excel file not equal will change cellstyle color to
> red on Result file. 
> Problem is with below code Result file is blank there is no content. 
> I understand my code is incorrect as SXSSFWorkbook is creating new sheet. 
> HOW CAN I update result file with  change cell color?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.