use strict; use warnings; use List::Util qw(reduce); use Data::Dumper; my $hash = reduce { ${ $a->{ $b->[1] } }->{ $b->[2] } = $b->[3]; $a; } {}, grep { @$_ > 3 } map { [ split /\s{2,}/ ] } map { chomp; $_ } <DATA> ; print Dumper( $hash ); __DATA__ 1 Sample 1 actin 20,514 2 Sample 1 claudin 30,544 3 Sample 1 occludin 31,183 25 Sample 1 actin 20,514 26 Sample 1 claudin 30,544 27 Sample 1 occludin 31,183 49 Sample 2 actin 20,416 50 Sample 2 claudin 25,611 51 Sample 2 occludin 27,831 73 Sample 2 actin 20,416 74 Sample 2 claudin 25,611 75 Sample 2 occludin 27,831 97 Sample 3 actin 24,213 98 Sample 3 claudin 32,065 99 Sample 3 occludin 34,556 121 Sample 3 actin 24,213 122 Sample 3 claudin 32,065 123 Sample 3 occludin 34,556 145 Sample 4 actin 20,498 146 Sample 4 claudin 25,365 147 Sample 4 occludin 27,869 169 Sample 4 actin 20,498 170 Sample 4 claudin 25,365 171 Sample 4 occludin 27,869 193 H2O actin 194 H2O claudin 195 H2O occludin 217 H2O actin 218 H2O claudin 219 H2O occludin


holli

You can lead your users to water, but alas, you cannot drown them.

In reply to Re^3: table into complex data structure by holli
in thread table into complex data structure by ic23oluk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.