CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2001
    Posts
    5

    Text processing & File I/O

    I'm trying to read in data from a text file (data is in column format) and store it in arrays. Is there any simple method to do it, or must I read in line by line and process each line character by character?



  2. #2
    Join Date
    Jun 2001
    Location
    Israel
    Posts
    228

    Re: Text processing & File I/O

    you can read each line and then separate easily by the Split() command.
    dim strData() as String
    dim nData() as Integer
    dim Line as String
    dim i as Integer
    ...
    read line string here into Line
    ...
    strData=Split(Line," ")
    ReDim nData(0 to UBound(strData))
    for i=0 to UBound(strData)
    nData(i)=strData(i)
    next i

    This code might need some small fixes because i didn't check it...

    ----------
    The @host is everywhere!
    ----------

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

Featured