Tuesday, August 6, 2019

Replace word or text in a file with command line in Windows

Replace word or text in a file with command line in Windows


powershell -Command "(gc BeforeReplace.txt) -replace 'OrginalTextToBeReplaced', 'NewTextToBeReplaced' | Out-File -encoding ASCII AfterReplace.txt"

No comments:

Post a Comment