getting sed to hold lines and print them out again- help please
hello all.
so i have this text file, a section of which looks like this: Quote:
Quote:
is that right guys? i am very new to sed and am struggling. many thanks in advance for any help. |
Here is a simple awk solution:
Code:
$0 ~ /:/ { header = $0 ; |
You can do this with sed, but it is very unintuitive. I would recommend awk:
/^K/ { prefix=$0 print prefix } /^[0-9]/ { print prefix, $0 } Put that in a file xxx and run with "awk -f xxx yourdata" HTH |
thanks very much guys.
|
All times are GMT -5. The time now is 09:25 AM. |