How to get the column names in an Excel file using Apache POI, to make sure that the columns are ordered as expected.
Just click the Navigation Pane button under Kutools Tab, and it displays the Navigation pane at the left. Under the Column Tab, it lists all column header names.
There is a convenience method for this:
CellReference.convertNumToColString(cell.getColumnIndex());
To get the full name:
private static String getCellName(Cell cell)
{
return CellReference.convertNumToColString(cell.getColumnIndex()) + (cell.getRowIndex() + 1);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With