简体   繁体   中英

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

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. 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 '#'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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