|
-
Aug 10th, 2000, 01:36 AM
#1
Thread Starter
New Member
Hi all..
I have a little problem, i want to from a textfile with data in 3 column rows separated with a '\t' read in this data to an a array. The size of the txtfile isn´t always the same size, so a couple of loops sureley would do tha trick..
Any VB-GURU who wants to help a desperate Swede..
Your Sincerely/Kippe
-
Aug 10th, 2000, 02:24 AM
#2
Hyperactive Member
Hi, I'm not a guru, and I'm not very good, but I think I have a bit of code that'll help.
Ok, this is all off the top of my head:
Code:
Dim Array(1 to 3) As String
Dim Filenum As Long
Filenum = Freefile
Open "C:\yourfile.ext" for Input as Filenum
While Not EOF(Filenum)
Line Input #Filenum, Data
Array = Split(Data, "/t")
text1.text = text1.text & vbcrlf & Array(1)
text2.text = text2.text & vbcrlf & Array(2)
text3.text = text3.text & vbcrlf & Array(3)
Data = ""
Wend
Close #Filenum
Don't forget to make your textboxes multiline, otherwise it'll come out in all one line, each set of data separated by two vertical lines, symbolizing the line break.
Let me know if this works. I'm pretty sure I used the right syntax...
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
|