i have to read 10 lines from the middle of a file, i tried to use seek method but it requires number of bytes. i dont know how many bytes will be contained in 10lines. how can i tell seek to read 10 lines from a specified location.
ayesha25 0 Newbie Poster
Recommended Answers
Jump to PostIf the file you're trying to read is a textfile, then you can use the TextReader's ReadLine method.
Try this and see if it helps.
TextReader reader = New StreamReader("<file to read>"); string line = ""; int startReadingHere = <enter line number here>; int lineIndex = …
All 3 Replies
Oxiegen 88 Basically an Occasional Poster Featured Poster
Geekitygeek commented: my thoughts exactly :) +1
Oxiegen 88 Basically an Occasional Poster Featured Poster
Geekitygeek 480 Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.