Click here to Skip to main content
16,020,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am working on reading contents of a csv files. its working fine but i have a condition here. My actual contents start from the second line of file(first line contains some info say "TITLE of the file").
i want to escape neglect this line and start reading from the second line. i have been searching for a while but could not find the exact solution. Please help.
Posted

1 solution

If you are using a StreamReader, just call once ReadLine() without checking the result.
If you need to use the Stream with some other code, you can:
C#
StreamReader sr = new StreamReader(stream);
sr.ReadLine();//will advance the stream cursor to the next line

After that, code reading from stream will begin at the next line.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900