Jump to content

search and replace


markj
 Share

Recommended Posts

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!!!!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

i am a pleb :)

There's a new one!

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.

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...