Return just list of files

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

Return just list of files

Postby YourMum » Mon Sep 19, 2005 12:37 pm

I would like to perform a "Find in Files" with all the parameters Find, In Files/Types, Directory, but for the output to only show the names (path) of the files which contain matches.

I do not want the usual output, e.g.:
Code: Select all
----------------------------------------
Find 'STDHDG01' in 'E:\YM\September 2005\Sqr\SQR\XRFWIN.SQR' :
E:\YM\September 2005\Sqr\SQR\XRFWIN.SQR(59):    #include 'stdhdg01.sqc'
Found 'STDHDG01' 1 time(s).
----------------------------------------


I want something like:
Code: Select all
----------------------------------------
Find 'STDHDG01' in folder 'E:\YM\September 2005\Sqr\SQR' :
E:\YM\September 2005\Sqr\SQR\XRFWIN.SQR
E:\YM\September 2005\Sqr\SQR\XRFRCPN.SQR
E:\YM\September 2005\Sqr\SQR\XRFRCFL.SQR
Found 'STDHDG01' 3 time(s).
----------------------------------------

Is this possible?

TIA.
YourMum
User avatar
YourMum
Newbie
 
Posts: 4
Joined: Sun Sep 18, 2005 11:00 pm

Re: Return just list of files

Postby Mofi » Tue Sep 20, 2005 5:25 am

You will not get this result directly. But you can activate the "Result to Edit Window" option and run this macro to get only the filenames with path and the number of files found for the specified search string at bottom of the result.

InsertMode
ColumnModeOff
HexOff
UnixReOff
Top
Find RegExp "%Find *^p"
Replace All ""
Find RegExp "%Found *^p"
Replace All ""
Find RegExp "/[0-9]+: *$"
Replace All ""
Find "----------------------------------------^p"
Replace All ""
SelectToBottom
StartSelect
Key UP ARROW
SortAsc RemoveDup 1 -1 0 0 0 0 0 0
EndSelect
Find RegExp "[0-9]+ time(s). (^(*^))"
Replace All "in ^1"
UnixReOn

Remove the last red command, if you use regular expression in UltraEdit style by default instead of Unix style - see Advanced - Configuration - Find - Unix style Regular Expressions. UnixReOn/UnixReOff modifies this setting.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4057
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Return just list of files

Postby YourMum » Tue Sep 20, 2005 7:31 am

Wowsers. Thanks. That did what I wanted. Thanks very much, Mofi.

YM
User avatar
YourMum
Newbie
 
Posts: 4
Joined: Sun Sep 18, 2005 11:00 pm


Return to Find/Replace/Regular Expressions