0

I am still relatively new to the new SS API for Apache POI unified XLS/XLSX querying.

Could someone please advise for how to:

a) do a retrieval of all the column names up to those where there is a data in the columns. For example, there is data only in columns up through D (it is ok if some inner columns are empty, e.g. "C").

b) do a column-oriented retrieval of the data. For example, I want to all values in the column named "Salary" or "D".

Edmon
  • 4,752
  • 4
  • 32
  • 42
  • 1
    What have you tried? All columns have data up to the last column you touched, so you have to clarify what "there is data" means. – ergonaut Sep 24 '15 at 17:31
  • I have tried matrix non-sparsity, shape test in nxm but I suspect it might not be the most efficient. I am looking for any column-oriented features in the API that cover both formats. – Edmon Sep 24 '15 at 18:21
  • 1
    I'm not quite sure what you mean. Can you just run a for loop across your sheet and pull the cell contents? – ergonaut Sep 24 '15 at 18:24
  • I can, but I was wondering if there was an API that would tell me how many columns have values. I.e. what is the last column with populated data. Something that gives me m and n boundaries if we look at the sheet as a nxm matrix (n rows, m columns). – Edmon Sep 28 '15 at 01:08
  • possible duplicate of http://stackoverflow.com/questions/2645566/finding-the-last-row-in-an-excel-spreadsheet – ergonaut Sep 28 '15 at 13:40

0 Answers0