Read file and then replace word from csv file


i want replace words in config files, replace valor value in csv file example:

user      new user

abc        qwr

wer       123456

i want search word  "abc" , replace "qwr"

i write not know how add

$configfiles=get-childitem . *.config -rec
foreach ($file in $configfiles)
{
$file.pspath >> log.log
$a= "" + $file.pspath + ".bkp"
cp $file.pspath $a
(get-content $file.pspath) |
foreach-object {$_ -replace "decchi", "mono"} |
set-content $file.pspath

}


adecchi

can try , explain little better?  once run replace have write data file.  more exact explanation of problem helpful.

hope helps! jason



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

server manager error: ADAM.events.xml could not be enumerated.

Cannot access Anywhere Access using domain name?

WMI Failure: Unable to update Local Resource Group