【发布时间】:2017-07-27 16:32:31
【问题描述】:
大家好,
我想读取图像中显示的文档的值。
目前,我正在使用 switch-case 语句来保存数据,但很难区分 1. Contact 和 2. Contact。
case "Address Line"
contact1.setAddressLine(cellIterator.next().getStringCellValue());
case "City"
contact1.setCity(cellIterator.next().getStringCellValue());
case "County"
contact1.setCounty(cellIterator.next().getStringCellValue());
...and so on for Address
case "Number of Students"
contact1.setAddressLine(cellIterator.next().getStringCellValue());
case "Number Of Professors"
contact1.setAddressLine(cellIterator.next().getStringCellValue());
这适用于University 和Professors,但不适用于Contact。
谁能指导我如何做到这一点?
(子问题:是否可以读取所有不固定到特定结构的值并将其存储?)
【问题讨论】:
标签: java excel apache-poi java-io