I am not sure what I need to set for the parameters so it will not throw a error on this section of csv data
LumenWorks.Framework.IO.Csv.MalformedCsvException was unhandled by user code
Message=The CSV appears to be corrupt near record '105' field '2 at position '42'. Current raw data : '"
106, 224,"zzzAFFINITY - "PD" ","AFFINITY ", 144, 9," ","E ","SW WARMBLOOD ","ESW WARMBLOOD ","BAY ","F ", 0.00,"N "," ","10/07/1991 ","10/07/1991 "," ","01/01/1988 ","I ","M "," ", 0, 0.00, 0.00," "," "
107, 224,"zzzSPOCK ","KOHLINAHR ", 145, 12," ","E ","SW WARMBLOOD ","ESW WARMBLOOD ","BAY ","M ", 0.00,"Y ","N ","04/05/2000 ","03/28/2000 "," ","01/01/1986 ","I ","G "," ", 0, 0.00, 0.00,"STAR, SNIP. LH & RH SOCKS, RF PASTERN "," "
108, 224,"zzzTIA **DEAD ","ACACIA ", 146, 12," ","E ","DAN WARMBLOOD ","EDAN WARMBLOOD ","CHES ","F ", 0.00,"N ","N ","05/12/1995 ","05/12/1995 "," ","01/01/1984 ","I ","M "," ", 0, 0.00, 0.00,"BLAZE, LH SOCK "," "
109, 224,"zzzMENDELSSOHN ** ","HORSE BELONGS TO F.E.D. ", 147, 9," ","E ","SW WARMBLOOD ","ESW WARMBLOOD ","CHES ","M ", 0.00,"Y ","N ","11/15/1989 ","11/02/1989 "," ","01/01/1980 ","I ","G "," ", 0, 0.00, 0.00,"**SEE DIXON** "," "
110, 224,"zzzSCOTTY ","SCOTTISH CHARMER ", 148, 9," ","E ","THOROUGHBRED ","ETHOROUGHBRED ","BAY ","M ", 0.00,"Y "," "," "," "," ","01/01/1984 ","I ","G "," ", 0, 0.00, 0.00," "," "
111, 224,"zzzRIDDLES ","ERIDANUS ", 149, 9," ","E ","DAN WARMBLOOD ","EDAN WARMBLOOD ","DARK BROWN ","M ", 0.00,"Y ","N ","05/28/1996 ","05/28/1996 "," ","01/01/1984 ","I ","G "," ", 0, 0.00, 0.00," "," "
112, 223,"zzzFRUHWIND ","FRUHWIND - DECEASED ", 150, 9," ","E ","GERMAN TB ","EGERMAN TB ","BLACK ","M ", 0.00,"N "," ","07/09/1990 ","05/21/1990 "," ","01/01/1969 ","I ","S "," ", 0, 0.00, 0.00," "," "
113, 223,"zzzCASS ","CASTAGNA ", 151, 9," ","E ","SW WARMBLOOD ","ESW WARMBLOOD ","BAY ","F ", 0.00,"N "," "," "," "," ","01/01/1983 ","I ","M "," ", 0, 0.00, 0.00," "," "
114, 223,"WINDSOR ","WINDSOR '.
Source=LumenWorks.Framework.IO
CurrentFieldIndex=2
CurrentPosition=42
CurrentRecordIndex=105
RawData=(snip)
My guess is it is the quotes around "PD" that are causing the problem. Is there any way to fix this? Here is what I am currently using for my constructor.
using (var csv = new CsvReader(new StreamReader(Path.Combine(txtPath.Text, filename)), true, ',', '"', '\0', '#', ValueTrimmingOptions.All))
|