I have developed an ASP .Net application which imports a csv file into
SQL using SQL bulkcopy. The problem is I need to change my csv file
into certain format (like spliting one column into two columns...etc)
before uploading into database. I thought I will read the input csv
file and write it into a new csv file with my changes with the help of
ReadRecord event but couldnt accomplish it.
My input csv file has columns like
County, SubDivision, AddressRange(Ex;114-118)......
Output csv file should have Address range splited into two two columns
AddressTo and AddressFrom
County, SubDivision, AddressTo(Ex; 114), AddressFrom(Ex: 118)
Can you please help me regarding this.
e.Values["AddressFrom"] = e.Values["AddressRange"].Split('-')[0];
e.Values["AddressTo"] = e.Values["AddressRange"].Split('-')[1];
That should be all you need to do.
Bruce Dunwiddie