HandyFile Find And Replace Online Help Submit feedback on this topic   

HOWTO: Use Command Line Switches

The HandyFile Find And Replace has an extensive set of command-line switches allowing you to fully configure the tool when running it from the command line or batch file.

We shall consider some examples of running the HFFR from the command line. 

Note
Line-breaks in the command line samples are for readability only.

Find And Replace Simple Text In Files

Task

Replace all occurrences of the phrase Silver Age Software with SilverAge Software in HTML files in folder C:\MyWebFiles\Projects , including subfolders. The text requires case-sensitive search. Close the TW after the processing is done.

Command line

hffr.exe /folder:"C:\MyWebFiles\Projects" /recurse:on /type:"*.htm*"
/xwhat:"Silver Age Software"
/xwith:"SilverAge Software" 
/case:on /rx:off /replace:yes /run /close

Find And Replace Text In Files Using Regular Expressions

Task

Replace all occurrences of the tag SPAN, preserving the tag inner text in HTML files in folder C:\MyWebFiles\Projects , not including subfolders. The text search is not case-sensitive. Do not close the TW after the processing is done.

Command line

hffr.exe /folder:"C:\MyWebFiles\Projects" /recurse:off /type:"*.htm*" 
/xwhat:"\<span.#\>(.#)\<\/span\>"
/xwith:"\1"
/case:off /rx:on /replace:yes /run

Find And Replace Text In Files Using a Scenario

Task

Apply the previously created scenario MyScenario to HTML and ASP files in folder C:\MyWebFiles\Projects, including subfolders. Do not close the TW after the processing is done. Create the HTML report report.html in the folder C:\MyWebFiles\Projects.

Command line

hffr.exe /folder:"C:\MyWebFiles\Projects" /recurse:on /type:"*.htm*;*.asp" 
/scn:"MyScenario"
/list:"C:\MyWebFiles\Projects\report.html"
/run