Results 1 to 2 of 2

Thread: Sequential files again

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Posts
    335

    Sequential files again

    Hello there

    sorry for the multiple post for some reason i can not
    see it, or delete it.

    any way my quesion is

    if a text file is stored the following way

    Bert
    123
    Mark
    456
    I can access it as follows

    .....

    Do while sr.Peek <>-1

    name = sr.Readline 'sr is the IO stream reader
    phone = sr.Readline
    ...

    Loop

    How about if the file is stored as follows?

    "Bert",123
    "Mark",456

    Thank u in advance

  2. #2
    Hyperactive Member pgrimes's Avatar
    Join Date
    Aug 2001
    Location
    sacramento
    Posts
    342
    I didn't test this, but I think it will do what you need. It is a start at least.

    VB Code:
    1. Do While sr.Peek <>-1
    2.  
    3. info = sr.ReadLine   'Read in a line from your file
    4.  
    5.     tpos = info.Length
    6.     Do Until Mid(cptFilePath, tpos, 1) = ","
    7.            phone= Mid(info, tpos, 1) & phone
    8.            tpos = tpos - 1
    9.     Loop
    10.     name = Left(info, tpos)
    11.  
    12. Loop

    Paul

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