|
-
Apr 26th, 2006, 07:30 PM
#5
Addicted Member
Re: Input from textfile
 Originally Posted by Mythrandil
darn tht reads the whole file lol.
Code:
31-Mar-06,6015.20,6019.20,5961.40,5964.60,1650124544,5964.60
30-Mar-06,5959.20,6036.00,5959.20,6015.20,1496758016,6015.20
29-Mar-06,5935.70,5979.70,5927.20,5959.20,1742429440,5959.20
thats the file format,
i need the last value on each line. My plan was to take the last 7 chars from each line.
Anyone got a sure fire way of getting that last value for each line?
thanks
You can use the mid function to detemine the last 7 charecters from each line even if the size of the line is random.
VB Code:
Private Sub Form_Load()
Open "C:\test.txt" For Input As #1
While Not EOF(1)
Line Input #1, i
If Len(Text1.Text) = 0 Then
Text1.Text = Mid(i, Len(i) - 6, Len(i))
Else
Text1.Text = Text1.Text & vbNewLine & Mid(i, Len(i) - 6, Len(i))
End If
Wend
Close #1
End Sub
Add a textbox with multiline and it will add input the last 7 charecters with on each line.
Are we alive or just breathing?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|