Friday, June 24, 2016

grep print blank line after each file group

 https://stackoverflow.com/questions/8273636/add-blank-line-after-every-result-in-grep

Perl solution :

grep blah files | perl -F: -ap -e 'print "\n" if $f ne $F[0]; $f = $F[0];' 

And you're done.

-F : specify the character to be used for the split (space by default)

-a : autosplit into @F