User Tools

Site Tools


search_and_replace_in_all_files

Search and Replace in All Files

Command Line

Current directory:

for /r . %x in (*.csproj) do perl -pi -i.bak -e "s/searchterm/replaceterm/" "%x"

Specified directory (untested):

for /r "C:\Temp" %x in (*.csproj) do perl -pi -i.bak -e "s/searchterm/replaceterm/" "%x"

From a Batch File

Current directory:

for /r . %%x in (*.csproj) do perl -pi -i.bak -e "s/searchterm/replaceterm/" "%%x"

Specified directory (untested):

for /r "C:\Temp" %%x in (*.csproj) do perl -pi -i.bak -e "s/searchterm/replaceterm/" "%%x"

Switch Off Code Analysis

Current directory:

for /r . %x in (*.csproj) do perl -pi -i.bak -e "s/<RunCodeAnalysis>true<\/RunCodeAnalysis>/<RunCodeAnalysis>false<\/RunCodeAnalysis>/" "%x"

Specified directory (untested):

for /r "C:\Temp" %x in (*.csproj) do perl -pi -i.bak -e "s/<RunCodeAnalysis>true<\/RunCodeAnalysis>/<RunCodeAnalysis>false<\/RunCodeAnalysis>/" "%x"
search_and_replace_in_all_files.txt · Last modified: 2016/12/31 19:05 (external edit)