I'm currently attempting to change the contents of one file
to match the contents of an updated file
Replacing orig.sas with new.sas makes some of the changes, but there are many directories referenced within orig.sas that I do not want altered.
Submitting the following code outputs a script 'changes.txt' with all of the lines needed to be altered in orig.sas to make it identical to new.sas
diff -e orig.sas new.sas > changes.txt
changes.txt looks like this (full output has many more lines):
3668c label DBMS=xlsx replace; . 3649,3665d 3643d
From here I have removed all lines which reference changes in directories, so only the body of the code is affected.
I think I should be able to submit this script into sed (with the aim of making all of the changes changes.txt) using something like:
sed - orig.sas < changes.txt
But I don't want to directly overwrite the orig.sas, instead preferring to output to a version 2 file (eg. orig_v2.sas)
My progress to this point has come from instruction from https://www.computerhope.com/unix/udiff.htm