Trouble reading line by line from a text file

lurch
04-21-2003, 04:36 AM
This is what i have in a text file:

1ZOOMETRIC (12) S J MILLER (56)$ 6.70$ 6.20$ 4.70$ 4.90$ 2.40
2SHIRAZAMATAZZ (6) D J STAECK (56)$ 4.00$ 4.30$ 4.30$ 4.40$ 2.00
3CONSPIRATOR (3) G L SMITH (56)$21.80$20.60$22.20$22.70$ 6.20
4KING CANUTE (11) J S WHITING (56)$44.50$47.90$50.10$53.10$10.00
5WOOL ZONE (9) P KING (56)$22.50$20.50$22.40$21.40$ 5.70

This is the code I have:

Open "c:\Test.txt" For Input As #2
Do While Not EOF(2)
Line Input #2, strLine
If Len(strLine) > 30 Then
a = Len(strLine) - 11
b = Mid(strLine, a, 5)
End If
Loop
Close #2

txtOutput.Text = b

I'm trying to get it to read a line and then put the result in a RichTextBox.
Then read the next line and put the result in the RichTextBox, and so on.

The code i have only returns the result from the last line ignoring the rest e.g. "21.40"

Thanks
lurch

sjp
04-21-2003, 04:44 AM
try
b = b & Mid(strLine, a, 5) & vbcrlf

lurch
04-21-2003, 04:54 AM
try
b = b & Mid(strLine, a, 5) & vbcrlf

That worked...Thanks a million sjp

lurch

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum