I have been reading up on ways to read a CSV File in C# and I have heard that it is really complicated. What I am looking to do is have a console read a csv and if there are cells in column A that contain 123 it will delete all rows with a cell in column A with 123. BUT, as it does this all.. I need it to save to ANOTHER excel file so I have the original file as well. This is what I have to read the file.
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
Excel.Range range;
string str;
int rCnt = 0;
int cCnt = 0;
xlApp = new Excel.ApplicationClass();
xlWorkBook = xlApp.Workbooks.Open("123abc.csv", 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);