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: 2017/01/01 20:05 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki