Results 1 to 3 of 3

Thread: Parsing a file

  1. #1

    Thread Starter
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627

    Parsing a file

    This may be alot to ask but...
    I have the following text in a file and I want to strip out the pieces of text that are bold to write to another file.
    --------
    ftp>
    ftp> bin
    Verbose mode On.

    ftp> verbose
    get big-file.bin
    200 PORT command successful.
    150 Opening BINARY mode data connection for big-file.bin (12279212 bytes).
    226 Transfer completed.
    12279212 bytes received in 346.51 seconds (35.44 Kbytes/sec)

    ftp> quit
    221 Goodbye.
    Tue 08/13/2002
    8:52a

    ---------

    So far, I'm reading each line into an array, I'm able to get the get big-file.bin and I think the date and time will be easy to get, but I'm stuck at the speed - 35.44
    Since this will always be different, and the length of that line will be different, I'm getting stuck using the instr, mid, right, left etc etc string commands.
    Any help is appreciated.

    Thanks

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Use InStr to find the starting point of Kbytes, and then use InStrRev to find the left-parenthesys starting from the spot where you found the Kbytes. You should then be able to pull out the numbers inbetween.

  3. #3

    Thread Starter
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627
    Excellent

    Thank you for the help.

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