New to sed...
Have a file foo.txt (below).
Need to replace text on 2 lines, but can only feed sed the first few characters of each line (all lines are unique).
So, in my example, I have put '$' in place of what I need to figure out how to feed the whole line.
What I have thus far:
sed -e 's/LA$/LA=2345/g' -e 's/LA1$/LA1=7789' foo.txt
foo.txt:
LA=1234
LA1=23456
LA2=1987
Thanks, this board is wonderful.
Yes, I do search before posting.
---------- Post updated at 06:24 PM ---------- Previous update was at 06:12 PM ----------
May have answered my own question...
sed -e 's/LA=[a-zA-Z0-9]/LA=2345/g' -e 's/LA1=[a-zA-Z0-9]
/LA1=7789' foo.txt
Best way?
May be characters after, so that is why I did the a-z and A-Z.