Results 1 to 3 of 3

Thread: read in lineS of text into an array

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    83

    Resolved read in lineS of text into an array

    hey guys
    i've looked at other posts but can only seem to get this to work for 1 line:

    what i want to do.
    i have a txt file with data as such
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10


    i need to read this into an array eg:

    dim arrdata(1 to 10)

    open **** for input as #1

    lineinput #1, data

    and from there i'm lost>.........

    what is the code i need to:
    read line 1, store to arrdata(1)
    read line 2, store to arrdata(2)
    read line 3, store to arrdata(3)
    etc etc etc

    is there a way i could do it with a loop
    for i=1 to 10 step 1
    read line i ???????? store to arrdata(i)
    next i

    any help appreciated [especially good help cheers
    Last edited by new fish; Aug 26th, 2007 at 09:10 PM. Reason: [resolved]

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