Question : Delete first 1 or 2 rows from csv/text delimited file

Hi, I  am using VB.net and need to remove the the first 2 rows from a csv or txt delimted file in a process. I am importing files, before i run teh import process i need to strip out the Column header from the csv file. I need to delete the rows, save the file and then pass it onto the import process, i cannot do his in the import process. The file needs to be prepared first
Is there an easy way of doing this?
thanks

Answer : Delete first 1 or 2 rows from csv/text delimited file

Try below code:
1:
2:
3:
4:
5:
6:
7:
List<string> l = new List<string>();
string[] strFile =  File.ReadAllLines("C:\\Test.txt");
l.AddRange(strFile);
l.RemoveAt(0);
l.RemoveAt(0);
        
File.WriteAllLines("C:\\Test.txt", l.ToArray());
Random Solutions  
 
programming4us programming4us