AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

search and replace

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
badcoder
Guest





PostPosted: Sat Feb 26, 2005 5:08 pm    Post subject: search and replace Reply with quote

Hi!

I want to search and replace different words in a text.
For example:

Check text file for 'text'
replace 'text' by 'bits'
and so on...

What have I to do?
Back to top
Jon



Joined: 28 Apr 2004
Posts: 373

PostPosted: Sat Feb 26, 2005 5:24 pm    Post subject: Reply with quote

Have a look at StringReplace

If you are replacing a string from a text file have a look at Loop (Read Files and folders) as well.


Last edited by Jon on Sat Feb 26, 2005 6:34 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Sat Feb 26, 2005 5:34 pm    Post subject: Reply with quote

Also, almost every editor other than Notepad offers this simple functionality. Wink
Back to top
View user's profile Send private message
badcoder
Guest





PostPosted: Sat Feb 26, 2005 6:05 pm    Post subject: Reply with quote

Sorry.. I don't understand it.
Can you give me an example for search and replace, please.
Back to top
ranomore



Joined: 06 Nov 2004
Posts: 178
Location: Salt Lake City, UT

PostPosted: Sat Feb 26, 2005 8:28 pm    Post subject: Reply with quote

Documentation wrote:
StringReplace, OutputVar, InputVar, SearchText , ReplaceText , ReplaceAll


Code:

#j::  ;Windows+J
InputVar = Text
StringReplace,OutputVar,InputVar,text,bits
msgbox, %OutputVar%
return
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
exhueydriver



Joined: 12 Jul 2004
Posts: 51
Location: Fife,Wa

PostPosted: Sun Feb 27, 2005 4:18 am    Post subject: Reply with quote

jonny wrote:
Also, almost every editor other than Notepad offers this simple functionality. Wink

I must have a different version of Notepad, 'cause Find & Replace is there.
Don
Back to top
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Sun Feb 27, 2005 4:29 am    Post subject: Reply with quote

*smacks head*

I have a good excuse for overlooking it - I'm crippled by an insurmountable bias against any company that starts with micro and ends with soft. Laughing I could still name quite a few reasons why I prefer editor² over notepad.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group