Find and replace with cmd line params or multiple clipboards

Find, replace, find in files, replace in files, regular expressions

Find and replace with cmd line params or multiple clipboards

Postby mrZads » Fri Mar 03, 2006 9:57 am

Hi,

I was wondering if I can easily find and replace strings with a macro where the find and replace string is to be defined through parameters. I found the ^c option with find to get the string from the active clipboard but then I want to switch clipboard to replace the find string with the replace string.

Example:

FIND (text in clipboard 1)
REPLACE ALL (text in clpboard 2)

Thx.
User avatar
mrZads
Newbie
 
Posts: 1
Joined: Fri Mar 03, 2006 12:00 am

Re: Find and replace with cmd line params or multiple clipboards

Postby Mofi » Fri Mar 03, 2006 12:28 pm

That's not possible. The replace is in real 1 command and not 2. So it's not possible to use clipboard 1 for the find and clipboard 2 for the replace part of the replace command. But there is a workaround for this problem with ^s - selected text.

Top
"Temporarily pasted text from clipboard 1 ends here!"
Key HOME
Clipboard 1
Paste
SelectToTop
Clipboard 2
Find "^s"
Replace All "^c"
Top
StartSelect
Find MatchCase Select "Temporarily pasted text from clipboard 1 ends here!"
Delete
EndSelect

But if you only need this macro for replacing a text in a file run within a batch file, look at the free command line tools Xchang32.exe or Yank32.exe from Clay's Utilities for Win32, Version 1.0 Beta 6 which work fine and are very powerful.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4062
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Find/Replace/Regular Expressions