Hi,
I don't get this part:
Quote:
|
Can this be done without reading in each line individually and then writing back to another file? I really want to avoid this method since it removes all tabbing and thus creates a horrid file with each line aligned to the far left of the page.
|
This should work:
sed -i 's/AB = 12/AB = 12\nCD = 34/' infile
and the old fashion way also works:
sed 's/AB = 12/AB = 12\nCD = 34/' infile > outfile
This should not interfere with the layout of the file (this is also true for awk and other programs). You can manipulate those things, it's not done by default.
Hope this helps.