I am trying to replace text in a large text file, 5gb. I found the script below. It outputs to a new file.
powershell -Command "(gc myFile.txt) -replace 'foo', 'bar' | Out-File -encoding ASCII myFile.txt"
I am trying not to create another file because of the size. How do I replace text in a text file without saving it to a new file.
Try to use: