search within selected text

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

search within selected text

Postby jeoin » Fri Sep 01, 2006 5:48 pm

I need a method to search within the text I have selected. More specifically within columns.
Example I need to search for XY in the following text

01234 [position]
------------
ASSDF
WERFS
XYEXY
AERED
DVPXY
------------
I put the editor into column mode and select the last two columns. I would like to find both instances of XY in position 3 and 4, but not XY in position 0 and 1.
User avatar
jeoin
Newbie
 
Posts: 1
Joined: Thu Aug 31, 2006 11:00 pm

Re: search within selected text

Postby Mofi » Sat Sep 02, 2006 11:32 am

A search cannot be limited to a specifc range, whether in normal nor in column mode. Use a regular expression search. For example in UltraEdit style - see search configuration settings:

Find: %???XY

Well, it marks also the first 3 characters. But this should be no problem. A small macro could be used to mark only the 2 characters if this is really important:

InsertMode
ColumnModeOff
HexOff
UnixReOff
Find RegExp "%???XY"
IfFound
EndSelect
Key LEFT ARROW
Key RIGHT ARROW
StartSelect
Key LEFT ARROW
Key LEFT ARROW
EndSelect
EndIf

Add UnixReOn or PerlReOn (v12+ of UE) at the end of the macro if you do not use UltraEdit style regular expressions by default - see search configuration. Macro command UnixReOff sets the regular expression option to UltraEdit style.

Macro property Continue if a Find with Replace not found is not important for this macro, but better uncheck it.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4069
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: search within selected text

Postby MichaelF » Tue Sep 12, 2006 4:02 pm

I'm going to request it as a feature, but here's how I do it now:

Select the columns.
Use Replace.
Select "Selected Text" in the "Replace Where:" frame.
Put what you want to find in the "Find What:" box.
Tell it to Start, and just keep hitting Find Next.

This has its drawbacks, such as today, when I was looking through a file of 355,000 lines with lots of occurances of what I needed to find (I really like the "List Lines Containing String" feature in the real Find command).
I hope this takes care of your problem.
User avatar
MichaelF
Newbie
 
Posts: 1
Joined: Mon Sep 11, 2006 11:00 pm

Re: search within selected text

Postby dyslexic_dba » Wed Oct 11, 2006 11:11 pm

MichaelF wrote:I'm going to request it as a feature, <SNIP>

This would be a really useful thing for us.

We use UE for working on PL/SQL packages which contain many individual functions/procedures etc. It would be great if you could easily search just one procedure for something.

As it is now I just copy/paste the proc into another window to contain my search.
User avatar
dyslexic_dba
Newbie
 
Posts: 2
Joined: Sun Oct 08, 2006 11:00 pm


Return to Find/Replace/Regular Expressions