简体   繁体   English

lumen Works cssv阅读器无法读取以#符号开头的值

[英]lumen works cssv reader not reads the values starting with # symbol

i have a code snippet in c# which helps in reading the csv file in to list .the problem is it is not reading the record which starts with # symbol 我在C#中有一个代码段,可帮助读取列表中的csv文件。问题是它不是读取以#符号开头的记录

for instance if i have two record like this, then only sderik record i taken and the other record is missing as it starts with # symbol. 例如,如果我有两个这样的记录,那么我只记录了sderik记录,而另一个记录则丢失了,因为它以#符号开头。 what coul be the reason? 是什么原因?

sderik  |  sample1 | sample 2| sample 3

#smissingrecord  |  sample1 | sample 2| sample 3

using (LumenWorks.Framework.IO.Csv.CsvReader csv = new LumenWorks.Framework.IO.Csv.CsvReader(reader, true,'|'))
                {
                    outDataTable = Common.CommonFunction.ConvertListToDataTable(csv.ToList());
                    retValue = true;
                }

The # is the default comment character. #是默认的注释字符。 Override it by including a 6th parameter to the CsvReader call that is not '#'. 通过在CsvReader调用中包含一个不是'#'的第六个参数来覆盖它。

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

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