使用 Apache POI 在 Excel 文件中获取列的名称 [英] Get columns' names in Excel file using Apache POI

查看:62
本文介绍了使用 Apache POI 在 Excel 文件中获取列的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 Apache POI 获取 Excel 文件中的列名,以确保列按预期排序.

How to get the column names in an Excel file using Apache POI, to make sure that the columns are ordered as expected.

推荐答案

或者这个:

cell.getSheet().getRow(0).getCell(currentcellIndex)
    .getRichStringCellValue().toString()

行索引从 0 开始.

这篇关于使用 Apache POI 在 Excel 文件中获取列的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆