Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

Powershell - Replace words in every files of the current directory

Dec 6 2011 1:04AM by Sergejack   

Powershell is a free, powerful and handy tool which worths a try and now (since Windows 7) comes bundled with windows.

To replace a set of words with others (in a case sensitive manner) in every files of the current directory and its subdirectory, you may proceed like this:

Get-ChildItem . -Include *.* -Recurse | % {Out-File $_.FullName -Encoding utf8 -InputObject ((Get-Content $_) -creplace('helloworld', 'mystock') -creplace('HelloWorld', 'Mystock') -creplace('HELLOWORLD', 'MYSTOCK'))}

Here, I replace helloworld, HelloWorld and HELLOWORLD with mystock, Mystock and MYSTOCK (respectively). (I set the file encoding to be utf8, which is not required of course)

Read More..   [0 clicks]

Published under: SQL Server Tips ·  ·  ·  · 


Sergejack
41 · 4% · 1393
5
 
0
Knew
 
 
0
Incorrect
 
0
Interesting
 
0
Forgotten



Submit

Your Comment


Sign Up or Login to post a comment.

"Powershell - Replace words in every files of the current directory" rated 5 out of 5 by 5 readers
Powershell - Replace words in every files of the current directory , 5.0 out of 5 based on 5 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]