Hi Everyone,
I have the following code -
- static void Main(string[] args)
- {
- Console.Clear();
-
- string fileName = "\\file1.csv";
-
- fileName = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + fileName;
- var fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
- using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
- {
- string line,ID, UniqNumber;
- while ((line = streamReader.ReadLine()) != null)
- {
- ID = line.Length >= 1 ? line.Substring(1,7) : string.Empty; UniqNumber = line.Length >= 1 ? line.Substring(8, 12) : string.Empty;
-
- Console.WriteLine("ID={0},UniqNumber={1}", ID, UniqNumber);
- }
- }
- Console.ReadKey();
- }
I want to skip the first row while performing the operation. PLease help to omit the first line as it may contains invalid data.
Thanks,