Sign in to follow this  
Followers 0
markj

search and replace

9 posts in this topic

Does any one have a simple script that i can play with that will search and replace text within a file?

i.e. a gui opens up - select the file location, text to search for and text to replace with.

The best i will ever be is a beginner!!!!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

you can simply write it yourself...

read sth. in the help about FileRead() and FileWrite() but if you have few time i can make you an example...

EDIT:

a little help would be this... just programm a gui for it and the needed controls:

$text = "text"
$file = FileRead("file.txt")

$string = StringInStr($file, $text)

If $string = 0 Then
    MsgBox(0, "String", "The String wasn't found")
Else
    MsgBox(0, "String", "The String was found at Position: " & $string)
EndIf
Edited by Lord_Doominik

Share this post


Link to post
Share on other sites

thanks for the addition @valuater... forgot that he wants to replace a file...

Share this post


Link to post
Share on other sites

Thanks Guys

I will have a play - sorry for my lack of any knoweldge - i am a pleb :)

Share this post


Link to post
Share on other sites

i am a pleb :)

There's a new one!

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

xD... ye ^^...

and no prob for helping... everyone started as a beginner...

Share this post


Link to post
Share on other sites

thanks for the encouragement.

Pleb is a generally english slang term denoting one who is simple :)

And trust me my posts will probably get more simpler with every addition!

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