更新时间:2023-02-10 20:40:06
在这里我的建议是自己读取该文件,然后使用该库创建该文件。
My suggestion here is to read the file by yourself and then use the library to create the file.
读取CSV代码可以是简单的:
The code to read the CSV could be as simple as:
List<String> lines = new List<String>();
using (StreamReader reader = new StreamReader("file.csv"))
{
String line;
while((line = reader.ReadLine()) != null)
{
lines.add(line);
}
}
//Now you got all lines of your CSV
//Create your file with EPPLUS
foreach(String line in lines)
{
var values = line.Split(';');
foreach(String value in values)
{
//use EPPLUS library to fill your file
}
}