In the example I am replacing every .html file in the folder that has my line of
the words ‘old Text’ and replacing with words ‘new TeXT’ *(using Power Shell to replace strings)
You can change the file extension and update the location path to a single file to replace text in one file only.
get-childItem 'C:\scripts\*.txt' -recurse | ForEach {
(Get-Content $_ | ForEach {$_ -replace 'OLD TeXT', ' NEW TeXT'}) |
Set-Content $_
}
No comments yet.