I am really new to all this and I have have taken on a project that now seems abit out of my depth. I have found snippets of code through browsing and put them in some structure for what I beleive in need as you see below. the excel files have rows of data that I need to read and transfer over. The first row will have the same information in a particular number of columns, the next rows will then contain different data, but after checking so many rows, which will likely be blank, there is likely to be the same data as the first row, and so on and this could go on for many rows in one files. So I am trying to read all this to then store in memory and return it to a csv files. I have been reading up and looks like i need to use foreach and do loops with whiles in etc. This is the bit i am not understanding. Hope this makes sense. Any help would be apprciated.
C#:
Records = openExcelFile
List<csv> csv //this is the starting point, getting my files ready and open to read
Foreach (record in records)
{
// what type of row we have?
rowType = ValiateRow(record);
switch (rowTYpe)
{
Case RowType.Header:
Continue; //move to the next record
Case RowType.Blank:
blankRows++;
if (blankRows > maxBLankRows)
return; // We are at the end
else
continue; //next record
Case RowType.Valid:
DAF daf = ConvertTOCSV(record)
If (CSV!= null)
CSV.add(csv);
Continue;
}
} // can this be done for each record/file?