sanku has asked for the wisdom of the Perl Monks concerning the following question:
the out put should be displayed on particular column and also only the list which is having 2p397,2p409 like p element should be sorted only for p elements not for c Thanks in advance#!/usr/bin/perl open(FILE,"/Downloads/inputfile.txt") or die $!; while(<FILE>){ ($col1,$col2,$col3,$col4,$col15,$col6,$col7)=split(/\s+/,$_); @list=sort($col1,$col2,$col3,$col4,$col15,$col6); print @list; print "\n"; } close (FILE); my input file is like this c1p110 c2p452 9p235 8p226 5p100 6p218 c1p278 2p397 c6p280 7p273 3p409 my out put be like this 1 2 3 4 5 6 7 c1p278 2p397 3p409 c6p280 7p273 c1p110 c2p452 5p100 6p218
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: rearange the columns
by GrandFather (Saint) on Oct 31, 2008 at 09:43 UTC |