[root@phaniraj ~]# cat p1 | perl -p -e 's/^(usmat.*)\n(.*)/$1 phani $2 raj/m '