Hello all, i want to examine a file which have specific format for erroneous entries. For example i give u a few lines containing the errors i have found

Code:
19997 29 36  3   162  -210  -499 -1018  3420  1770  430875  4  4  2  1  5  3  3201
20097 29 48  2   182  -212  -510 -1003  3390  1748  246757 32  4 13 18 26 21254621
00792 11 9   5   -53  -356  -560 -1096  3454  1786  924438  2  2  2  3 10  6 10362
09407 13 26 12   485    -3  -395  -842  3178  1625  316700%1663%1177639711613352 91616
20197 30 45  2   163  -211  -498 -1018  3419  1768  431720  2  3  3  4  9  5  5727
20297 30 33  1   146  -218  -504 -1016  3398  1762  417309  0  0  0  0  0  0     0
The last value of the 2nd line should have length not more than 6 so as to be printed separated from its previous and the fourth line contains the % character.

To resolve this problem i use the following code

Code:
While Not EOF(1)
Input #1, a$
b$ = Right(a$, 6)
If InStr(a$, "%") = 0 And InStr(b$, "") = 0 Then
Print #2, a$
Else
deleted = deleted + 1
Print #3, a$
End If
Wend
while it works for the % character i can't find a specific condition for the last value problem. Any help is much appreciated.
Thank you in advance.