Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: creating a matrix like format

by NetWallah (Canon)
on May 19, 2016 at 17:47 UTC ( [id://1163504]=note: print w/replies, xml ) Need Help??


in reply to creating a matrix like format

Here is a one-liner option:
>perl -anE "$h{$F[3]}||=$col++; push @x,[$F[0],$h{$F[3]},$F[4]]}{say q +q|Gene\t\t|,join(qq|\t|,keys %h);for my $r(@x){say qq|$r->[0]\t|,map{ +$h{$_}==$r->[1]? $r->[2]:qq|\t|} keys %h}" data.2
Yes - it is a little ugly, but it works.

        This is not an optical illusion, it just looks like one.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1163504]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found