I am working on a project basically the flow as writtien below Read 2 Csv files Compare its content row by row and column identify rows which differ, even by a column Create a new Csv file to contain the difference
Problems encountered:
- I cannot read the csv file and store them inj the datatable. I can do it with xslx(excel file) keeps giving error on wrong file location
I am suspecting its a connection string error
i was using this String:
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FileDirectory + ";Extended Properties=\"Text;HDR= Yes;FMT = Delimited\"";
Oledbconnection Connection = new OleDbConnection(connectionString);
OleDbDataAdapter Adapter = new OleDbDataAdapter("select * from [" + Filesheet + "$]", Connection);
I am using Oledbconnection method, s there a more efficient method? without storing would be preferable
How do i run the program whereby it will autmatically access the file, the files are contain in 2 different folders and compare them file by file,as so far i only manage to do a particular file read
Do you guys have a better alternative way to solve this problem?
if (file1.Lines[i] != file2.Lines[i]) { file3.WriteLine(file2.Lines[i])}?