简体   繁体   English

读取Excel文件,在C#中获取数组中的单行

[英]Reading Excel file , getting single row in an array in c#

I have a old excel file , i want to modify that. 我有一个旧的excel文件,我想修改它。

i need to filter rows from my old excel file and write selected rows to new excel file. 我需要从旧的Excel文件中过滤行,并将选定的行写入新的Excel文件。

My plan is to read a single row,store it in a list,pass this arraylist to a function. 我的计划是读取一行,将其存储在列表中,然后将此arraylist传递给函数。

The function does some checking on the arraylist, if the condition is satisfied, i will write this entire row to my new excel file else i will go back and read next row. 该函数对arraylist进行一些检查,如果条件满足,我会将整行写入新的excel文件,否则我将返回并读取下一行。

I am not getting anything to read a single row and save it in a arraylist. 我没有任何东西可以读取一行并将其保存在arraylist中。

I am able to read cell by cell and do conditioning , but this is very slow. 我能够逐个读取单元格并进行调节,但这非常慢。

Any better option. 任何更好的选择。

同时将整个输入文件读取到定制对象中,进行处理,然后同时将所有这些数据写入最终的Excel文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM