perl -ne 'END{print @x} push@x ,$_; if(@x>2){splice @x,1,0,"\n" if /[[:alpha:]]\d[[:alpha:]]\s?\d[[:alpha:]]\d/;print splice @x,0,-2}'
If I cat my file into this, I get what you want ... it's ugly, but you want a shell (that is, one-line) :-) If I did this in full, I would be able to clear it to do its readable. :-)
Tanktalus
source share