perl -pale 'print $F[0]; @p=; s/^/$p[0] /' test.list #### perl -pale 'print $F[0]; ($p) = ; s/^/$p /' test.list