我必须从excel文件(xlsx格式)中读取,然后操纵该数据

时间:2022-09-01 22:13:44

I am doing a project for class and need help with this part. I just need to know if there is a way to read from an excel file line by line and manipulate that data. Specifically I am creating a "customer" object, and each line in the excel file is the data for the customer(name, address, etc.). I can't use any third party libraries or anything like that.

我正在为课堂做一个项目,需要这方面的帮助。我只需要知道是否有一种方法可以逐行读取excel文件并操纵该数据。具体来说,我正在创建一个“客户”对象,excel文件中的每一行都是客户的数据(名称,地址等)。我不能使用任何第三方库或类似的东西。

Is there a way to do this using BufferReader or FileInputStream. Those are the only 2 ways to read files we have gone over in class. I also tried saving it as a CVS file but it doesn't let me do so. Or Scanner using a delimiter?

有没有办法使用BufferReader或FileInputStream执行此操作。这是我们在课堂上阅读过的文件的唯一两种方法。我也尝试将其保存为CVS文件,但它不允许我这样做。或扫描仪使用分隔符?

Would I be able to just copy everything into a notepad and manipulate it from there?

我是否可以将所有内容复制到记事本中并从那里操作它?

1 个解决方案

#1


2  

Well, not using any third party library will be very hard as a homework. I highly recommand to use Apache POI

好吧,不使用任何第三方库将非常难以作为一项功课。我强烈建议使用Apache POI

Here is a good tutorial to start with POI.

这是一个从POI开始的好教程。

#1


2  

Well, not using any third party library will be very hard as a homework. I highly recommand to use Apache POI

好吧,不使用任何第三方库将非常难以作为一项功课。我强烈建议使用Apache POI

Here is a good tutorial to start with POI.

这是一个从POI开始的好教程。