Results 1 to 2 of 2

Thread: Plzz help me!!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Sweden
    Posts
    1

    Post

    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

  2. #2
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268
    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...
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width