Results 1 to 5 of 5

Thread: reading text files

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    37
    Hi
    I need to no how to read a text file with the following layout:

    Interface Statistics
    Received Sent

    Bytes 89041265 361026

    Unicast packets 2821 2645

    Non-unicast packets 510634 137

    Discards 0 0

    Errors 0 0

    Unknown protocols 178687

    and then plot the details in a OLE microsoft graph.

    Can anyone help please

    Many Thanks

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    OPen file for input as #1
        Line Input#1,InterfaceStat,ReceivedSent
        Line Input#1,Unicast
        Line INput#1,NonUnicast
        Line Input#1,Discards
        Line INput#1,Errors
        Line INput#1,Unknownprotocols
    close #1
    Input them all as strings and use val and right functions to get the numeric value of them
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Addicted Member jeroenh's Avatar
    Join Date
    Aug 2000
    Location
    Rotterdam, Holland
    Posts
    201
    Just go to www.vbworld.com and within the articles section there is one titled "Handling Files in Visual Basic". Anything you need should be in there.
    Catch you later,

    Jeroen Hoekemeijer
    Code:
    If 1 = 2 Then MajorError

  4. #4

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    37

    not worked

    i have tried what you have tried this but its not working i get an error on
    Line Input#1,InterfaceStat,ReceivedSent

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    What error did you get? Have you tried to declare them as strings?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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