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.

Recommended Answers

All 2 Replies

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
commented: Short and sweet +9

Thank You Reverend,

It works fine.

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.