Find the file and copy file/path name

Help with writing and playing macros

Find the file and copy file/path name

Postby mahesh113 » Wed Nov 07, 2007 12:05 pm

Hi all,

all my project related files are in say c:\Hsb\ folder and I've the file name which I need to search inside this folder. There are several sub-folders in Hsb folder. Can I search for the file name and copy the entire path including filename thru macros?

It will help me a lot. Please respond if u know the solution.

thanx.
User avatar
mahesh113
Newbie
 
Posts: 5
Joined: Wed Jan 10, 2007 12:00 am

Re: Find the file and copy file/path name

Postby Mofi » Wed Nov 07, 2007 12:40 pm

The following macro assumes that the file name which you want with full path is in the current clipboard and will be replaced in the clipboard with the full file name.

For details about the first part of the macro see Run Macro on all files within folder. You have not posted all necessary information to post here the macro which surely works for you.

Replace the second line of the macro with following if you use a project.

FindInFiles ProjFiles "" "" ""

The macro property Continue if a Find with Replace not found or Continue if search string not found must be checked for this macro.

UnixReOff
FindInFiles Recursive "C:\Hsb\" "*" ""
Loop
Find MatchCase Up "Search complete, found "
IfFound
ExitLoop
Else
NextWindow
EndIf
EndLoop
DeleteLine
Top
UnicodeToASCII
Find RegExp "%*^c*$"
IfFound
Copy
EndIf
CloseFile NoSave

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.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Find the file and copy file/path name

Postby mahesh113 » Sun Nov 11, 2007 6:50 am

Thanx Mofi,

I am sure that it will work for me. Only I need to update my Ultraedit, which is 10.10c currently. thanx a lot. :) :D
User avatar
mahesh113
Newbie
 
Posts: 5
Joined: Wed Jan 10, 2007 12:00 am


Return to Macros