Read columns as arrays
Hello! The second worksheet of every one of my workbooks has four columns with 24,000 rows. Ideally, I'd like to read in both sheets and each column needs to eventually exist as an array. Since this project converts each row to an object, is there a way to handle my case with columns to arrays?
We generally read rows, which are represented as an array. But you want the columns as arrays?
We generally read rows, which are represented as an array. But you want the columns as arrays?
Exactly. Right now I have a workaround that reads in a row then adds each column as a new element in each array, but it would be better to just read in the entire array at once.
Excel is row oriented and so is the Apache POI library, so the only way to retrieve all values for the columns is to iterate over the rows. So I'm not sure how to approach this without pulling everything apart.
The quickest workaround would be to create a a writer that writes to the array(s) you need, stores it somewhere (maybe in the jobcontext) then have another step operate on that array.
Ok, thanks. That is how I'm currently handling it.