我正在尝试在我的项目中实现 FILEHELPER 2.0,但是一些带有“”引用的 csv 文件面临问题。它显示错误(显示此错误日志)
**" LineNumber | LineString |ErrorDescription 2|"Symbol","Date","Expiry","Strike Price","Open","High","Low","Close","LTP","结算价“,“不。of contract","Turnover in Lacs","Open Int","Change in OI","Underlying Value "|长度不能小于零。-> 参数名称:长度不能小于零。-> 参数名称:长度 3|" **
我的代码是这样的:
var engine = new FileHelperEngine<script>();
engine.Options.IgnoreFirstLines = 1; // skipping the header line
script[] res = engine.ReadFile("agile.csv"); <<<<< at this line error occred
和我的课程文件:
[DelimitedRecord(",")]
public class script
{
[FieldQuoted('"', QuoteMode.AlwaysQuoted)]
public string Symbol;
[FieldQuoted('"', QuoteMode.AlwaysQuoted)]
public string Date;
[FieldQuoted('"', QuoteMode.AlwaysQuoted)]
public string Expiry;
[FieldQuoted('"', QuoteMode.AlwaysQuoted)]
...
}
和 csv 文件是 .
"交易品种","日期","到期","行权价","开盘价","最高价","最低价","收盘价","LTP","结算价","合约数量"," Lacs 的营业额","Open Int","OI 的变化","基础价值"
"漂亮","2012 年 8 月 31 日","2012 年 9 月 27 日","5400.00","56.00","56.90","38.05","44.45","43.55","44.45","281087 ","765592.77","4845150","1334150","5258.50"