try like
fn = "c:\temp\qwerty.txt"
f = FreeFile
Open fn For Input As f
    num = Val(Input(LOF(f), #f))
Close f
Open fn For Output As f
    Print #f, num + 1
    Close f
change file path\name to suit, if you want leading zeros on your number, format to suit, num variable content can be inserted to any string
in this case total file content was assumed to be one number (66)