I want to remove the path G:\Data\editor\
from a text file and replace it with ..\
using powershell.
How do I go about doing that?
powershell -Command "(gc sample.txt) -replace 'G:\Data\editor\', '..\' | Out-File -encoding ASCII sample.txt"
I had used the answer found here, but it doesn't seem to be working when looking for a path.