且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在没有Apache POI的情况下解析Excel文件

更新时间:2022-06-16 00:28:16

CSV是一种文本格式,因此可以使用分隔符进行解析。旧Excel是二进制和专有格式,因此需要巧妙的解码。新的Excel格式是压缩的XML,但是在将其转换为像逐个读取单元格这样简单的东西之前,还应该理解该文档的结构。所以问题的答案是否定的,你需要使用Apache POI,而且 - 这没有什么不妥。

CSV is a text format, so it can be parsed using the delimiters. Old Excel is a binary and proprietary format so it needs clever decoding. The new Excel format is zipped XMLs, but one should also understand the structure of this document before it could be transformed into something as simple as reading cells one by one. So the answer to your question is no, you'll need to use Apache POI, and also - there's nothing wrong with that.

作为旁注,路径上要成为一名优秀的开发人员,您需要学习在寻求帮助之前做一些自己的研究。弄脏手是学习东西的***方式。

As a side note, on the path to become a good developer you will need to learn to do a bit of your own research before looking for help. Get your hands dirty is the best way to learn things.