I have two files, say, one.dat and two.dat. I want sed to find the line
Code:
extern MY_FLOAT ...;
in one.dat and then copy the "MY_FLOAT ...;" (without the quotes, of course) to two.dat exactly on the line before
. The ellipsis ... indicates a sequence of variables (e.g. a,b,c,d --- which varies from one one.dat file to another). The line with extern MY_FLOAT is always closed by a semicolon and the so should the pasted counterpart in two.dat.
I know it's possible but sed is complex and I know only the very basics.
Thanks!