Results 1 to 2 of 2

Thread: Txt File "Selective Input"

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Atlanta, GA
    Posts
    80

    Question Txt File "Selective Input"

    I need to scan a text file for lines that contain the word "error." The file gets to be rather large over time and don't I want to
    Code:
    Do Until EOF(iFile)
         Line Input #1, strLine
         'Process Here
    Loop
    each time unless I have to.

    Is there a way to read in ONLY the lines that contain the selected text?

    Thanks!
    Kevin
    Kevin

  2. #2
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Sorry, but that's not possible... you'll still have to loop trough all the lines of text in the file. But you can optimize the code to make it faster... all you need is a "Line Input" and an "If Left(...) Then", more than that and it might get too slow.
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

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