Hi,
I am trying to use sed to replace a file path within all the .lay (.txt) files in a folder. I feel that this should be easy but I can't get it to work no matter what i try.
I'm using cygwin.
For a .txt file containing the below line I want to replace this file path with a new one.
$!VarSet |LFDSFN1| = '"E:\OLD\FILE\PATH TO DATA\data.txt"
Below is what i think should work.
old_file_path="E:\OLD\FILE\PATH TO DATA\data.txt"
new_file_path="E:\new\file\path"
sed -e 's|$old_file_path|$new_file_path|g' *.lay
I've tried placing the variables inside the command, defining the input and output files. I've changed the delimeter to |, as using back or forward slashes is problematic with file names. I have tried other methods on fouums, but can't get anything to work.