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

163 Views Asked by At

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;
                }
1

There are 1 best solutions below

0
On

The # is the default comment character. Override it by including a 6th parameter to the CsvReader call that is not '#'.