0

Good Day All,

I like to seek assistance for reading a file that has header and trailer information. I want the application to ignore the header lines (say the first 6 lines of the file) and also ignore the trailer which is always the last 2 lines of the file.

Please kindly accord me with this assistance.

Thank you.

2
Contributors
2
Replies
9
Views
3 Years
Discussion Span
Last Post by ibpet11
1

Just replace Debug.WriteLine... with your own code

Dim lines() As String = System.IO.File.ReadAllLines("d:\temp\test.txt")

For i As Integer = 6 To UBound(lines) - 2
    Debug.WriteLine(lines(i))
Next
Votes + Comments
Short and sweet
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.