several lines replace

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

several lines replace

Postby mutumba » Thu May 25, 2006 8:55 pm

hey all!

I have a little problem. How can I replace multiple lines with other multiple lines in uedit?

thx.
User avatar
mutumba
Newbie
 
Posts: 1
Joined: Wed May 24, 2006 11:00 pm

Re: several lines replace

Postby Bego » Fri May 26, 2006 4:45 am

Hi

IMHO it's best to write a macro that finds your "starting words", then "find select" your "ending words".
Then replace the marked text with your new text (e.g. by using multiple clipboards)
Put that in a macro loop and you've got it.
rds Bego
User avatar
Bego
Master
Master
 
Posts: 357
Joined: Wed Nov 24, 2004 12:00 am
Location: Germany

Re: several lines replace

Postby Mofi » Fri May 26, 2006 6:52 am

You can also use ^c and ^s with a normal replace (not a regex replace).

First select the lines of the replace block and copy it to clipboard (all 10 clipboards can be used). Then select the block to search for. Open the replace dialog and enter in the find field ^s and in the replace field ^c. Disable all options except Match Case if you want a 100% block match and run the replace.

This method works also with the search string in clipboard - ^c in find field - and the replace block is currently selected - ^s in the replace field.

^s and ^c can be also used in Replace In Files. The size limit for the blocks is 30000 bytes.

But take into consideration that the searched block must be identical (number, type and order of the characters) everywhere except for the case of the characters if Match Case is not used.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4039
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: several lines replace

Postby feng » Fri May 26, 2006 1:17 pm

wow, indeed. I never paid attention to that help item. When did UE add this feature? Thanks!
User avatar
feng
Basic User
Basic User
 
Posts: 11
Joined: Tue Aug 03, 2004 11:00 pm

Re: several lines replace

Postby Mofi » Fri May 26, 2006 4:15 pm

feng wrote:I never paid attention to that help item. When did UE add this feature?

The ^s and ^c codes? Well, since I used UltraEdit the first time which was v8.00 many years ago (I think). In v9.20 the maximum was increased to 30.000 bytes as mentioned in readme.txt (or read.me).

As I recommend very often, users should read the manual/help - the whole help. A user should always read the whole help of a program if he really uses it daily. There are so many "secrets" described in the help of really good applications that the time spent to read the whole help is regained in 1-4 weeks of usage.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4039
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Find/Replace/Regular Expressions