Grab our RSS feeds Follow us on Twitter Join our Facebook Group Connect with us on LinkedIn
myITforum.com, Powered by You.
you are not logged in

Articles

Newslinks

Links

Downloads

Site Services

Community Forums

Discussion Lists

Article Search

Newsletter

Web Blogs

FAQs

Live Support

myITforum TV

Take a Poll

Monthly Drawing

myITforum Network

User Group Directory

Our Partners

About Us

Register

Login

BRONZE PARTNER:

BRONZE PARTNER:



Industry News:




  Home : Articles : Windows PowerShell print | email | | Forums |   print | email | | Blogs |   print | email | | Wiki |   print | email | | FAQs |   print | email | Article Search  
Use PowerShell to do a mass text replace


Bookmark and Share

By: Rod Trent
Posted On: 7/8/2008

If you have a text, XML, or other text-based file in which you want to modify a string, use this Powershell one-liner.

Replace oldtext and newtext with the appropriate text strings.

=====================

dir | %{ $a = get-content $_ ; $a = $a -replace ("oldtext", "newtext") ; set-content $_ $a }

=====================

  myITforum.com ©2010 | Legal | Privacy