Using sed for grouping
October 29, 2010 at 11:42 pm Leave a comment
Fun game: using sed to group lines
sed -ne '/^BEGIN/, /^END/ H; /^END/ {x; s/\n/£/g; p;}'
You can then use grep to extract those groups that you are interested in and return them to normal formatting use
tr £ \n
Entry filed under: Uncategorized. Tags: command line fu, data munging, grouping, sed.
Trackback this post | Subscribe to the comments via RSS Feed