Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Replace string using wildcard in a file.

$
0
0

Hello,

Can PS replace string using wildcard in a file (xml file)? (replace newValue with oldValue)

 

The original file is:

<user oldValue="a1@aa.bb.cc.com" newValue=""></user>

<user oldValue="a2@aa.bb.cc.com" newValue=""></user>

<user oldValue="aa.bb.cc.com\a3" newValue=""></user>

 

The expected output file is:

<user oldValue="a1@aa.bb.cc.com" newValue="a1@aa.bb.cc.com"></user>

<user oldValue="a2@aa.bb.cc.com" newValue="a2@aa.bb.cc.com"></user>

<user oldValue="aa.bb.cc.com\a3" newValue="aa.bb.cc.com\a3"></user>

 

 

Thanks.


Viewing all articles
Browse latest Browse all 6937

Trending Articles