hi, im trying to figure out how to have sed delete something then append right after.
so lets say i have
sed -e '/.*IN.*MX.*/d' fileA
now on fileA i can have one line that has "IN MX" or many lines but what i would like to do is delete whatever lines have "IN MX" and add/append in the same place 1 new line.
I tried -e 's/.*IN.*MX.*/XXX/ fileA
but this will replace however many instances of IN MX that it finds, so if it finds 4 it will replace IN MX 4 times with XXX and i just want XXX added/append once.
TIA, P.A
so lets say i have
sed -e '/.*IN.*MX.*/d' fileA
now on fileA i can have one line that has "IN MX" or many lines but what i would like to do is delete whatever lines have "IN MX" and add/append in the same place 1 new line.
I tried -e 's/.*IN.*MX.*/XXX/ fileA
but this will replace however many instances of IN MX that it finds, so if it finds 4 it will replace IN MX 4 times with XXX and i just want XXX added/append once.
TIA, P.A