website - How can I automate a mass edit of text files located in a Win 8.1 directory? -


good day,

in specific directory under win 8.1, have these hundreds of text files extension *.xml, representing web site.

in each , every of files there 1 occurence of tag known content, <tag>old</tag>.

in these pages, specific text needs replaced <tag>new</tag>. subdirectories exist, not need examined.

how automate task? (i not familiar powershell, don't think i've ever used it, heading right direction? if not - apologies misleading tag.)

thanks in advance!

try powershell script.

$myfiles=get-childitem c:\folder *.xml -rec foreach ($file in $myfiles) {     (get-content $file.pspath) |      foreach-object {$_ -replace "<tag>old</tag>", "<tag>new</tag>"} |      set-content $file.pspath } 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -