1 2 3
# http://stackoverflow.com/questions/11290616/sed-conditional-merge-of-multiple-lines sed ':a;$!N;s/\n[a-zA-Z]//;ta;P;D'