Hello,Sharmila, The lines that you want to swap seems so ruleless,so it's maybe hard to find a good way for you. If you just want to handle the case listed below,I'll give a simple way:
$ cat t.txt $sc:(.+) <cit>(.+) $tic:(.+) $ perl -e '@tmp=<>;print shift @tmp;print reverse @tmp' t.txt $sc:(.+) $tic:(.+) <cit>(.+) > >Input: > >$sc:(.+) ><cit>(.+) >$tic:(.+) > >Output: > >$sc:(.+) >$tic:(.+) ><cit>(.+) -- Jeff Pang NetEase AntiSpam Team http://corp.netease.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>