On Tue, 22 Nov 2016, Scott Bigelow wrote:
> Not sure if I understand your input format well enough, but I think awk can
> handle it, something like:
>
> awk 'BEGIN{RS="\n\n"} { v[$0]++ } END { n = asorti(v,copy);
> for(i=1;i<=n;i++){ print copy[i] } }'
Scott,
My study of awk hasn't yet reached this point so I appreciate learning
from you.
The only glitch is that the first block is inserted at the end of the
output with no separation from the text block immediately preceeding it.
Adding a couple of blank lines above the first block does not affect the
results. Of course, manually moving that last block to the proper position
is not onerous, but I'll see if I can fix that in the code.
Many thanks,
Rich
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug