Reading text file only reading last line

For some reason im trying to read a text file with about 50 lines and it keeps only reading the last line???

    Dim sData As String
    Dim sinputline As String
    Dim ff As Integer
    ff = FreeFile
    sData = Empty

    Open sUpdateScriptSys For Input As #ff
        Seek #1, 1
        Do While Not EOF(ff)
            Line Input #ff, sinputline
            sData = sinputline
    Close #ff
Who is Participating?
fruhjConnect With a Mentor Commented:
Sdata = sinputline
should be
SData = SData + sInputline
Lee W, MVPTechnology and Business Process AdvisorCommented:
No, it's reading every line... you are just overwriting it each iteration of the loop.

What exactly are you trying to do - because the code you shown is just reading in the line and moving to the next line and not doing anything.
thaburnerAuthor Commented:
lol now i feel stupid i dont know what i was thinking. lol thx
been there and done that so don't feel bad.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.