Jump to content
Sign in to follow this  
njp988

How do i find a word in a text file

Recommended Posts

njp988

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.

Share this post


Link to post
Share on other sites
bobchernow

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]

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.