Jump to content

How do i find a word in a text file


njp988
 Share

Recommended Posts

So here's what Im trying to do;

I am trying to search a (very small) text file for the word "req:" and then I want to find the value after that code and then determine if that value (a number) is less then 20, or if it's greater then or equal to 20.

for example;

the line says "Req: 25"

I want to take the 25, then analyze it and determine it's more then 20.

Link to comment
Share on other sites

So here's what Im trying to do;

I am trying to search a (very small) text file for the word "req:" and then I want to find the value after that code and then determine if that value (a number) is less then 20, or if it's greater then or equal to 20.

for example;

the line says "Req: 25"

I want to take the 25, then analyze it and determine it's more then 20.

Try using FileOpen to open the file, FileReadLine, to read in a line at a time, then use StringInStr or StringRegExp to find your REQ:. Once you have that you can grab the number. The help on RegExp has a lot on how to.

Bob

--------------------bobchernow, Bob ChernowWhat a long strange trip it's beenUDFs: [post="635594"]Multiple Monitor Screen Resolution Change[/post]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...