Sign in to follow this  
Followers 0
soulhealer

a function to find a line contains text of "blablabla"

7 posts in this topic

#1 ·  Posted (edited)

is there a function to find a line from a textfile that contains text of "blablabla"(for example) ?

thanks for anyhelp. :whistle:

Edited by soulhealer

Share this post


Link to post
Share on other sites



Take a look at the File Manipulation functions in the helpfiles. Also, I'm sure a quick search on the forums could do you some good.

-CMR

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Try this:

Func fileHasString($P_Path , $P_text)
    Return StringInStr( FileRead( $P_Path , FileGetSize($P_Path) ) , $P_text  , 1 )
EndFunc

Edit: too late!

Edited by rbhkamal

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Take a look at the File Manipulation functions in the helpfiles. Also, I'm sure a quick search on the forums could do you some good.

-CMR

i found only, FileReadLine function. which it's only to find a line according to a defined line number. what i want, is a function to search a string, and then returns the line number as a result.

EDIT: too late too :whistle:

Edited by soulhealer

Share this post


Link to post
Share on other sites

i found only, FileReadLine function. which it's only to find a line according to a defined line number. what i want, is a function to search a string, and then returns the line number as a result.

while rbhkamal's is good... very good!

mine will show the line #

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

while rbhkamal's is good... very good!

mine will show the line #

8)

Thanks to both rbhkamal and Valuater. Both of your inputs are exactly what I needed. Now the script is working perfectly :whistle:

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  
Followers 0