I have a csv file which has a header row and 2 data rows but from source sometimes we get data rows split into multiple rows which in below case makes it 3 rows.
So my SSIS package gets failed when processing this csv file through C# code as it treats "ETF" line as a new row. I am currently using below code to add all of the data to an arraylist.
string sLine;
ArrayList arrText = new ArrayList();
StreamReader objReader = new StreamReader(filepath);
do
{
sLine = objReader.ReadLine();
if (sLine != null)
arrText.Add(sLine);
}
while (sLine != null);
I am new to C#, so can anyone please suggest how we can handle this sort of scenario so that my code can treat this file 2 have only 2 rows instead of 3 and load it into database.