Hi Monks, <\p>

I am having a very large tab delimited file and I am trying to parse the odd and even columns separately. I have stored the first column in the array and want to store the rest of the columns in two separate hash of arrays or some other data structure so that I can compare them in a quick time. Can you please help in this regard ? Also, it will be great if you can advise me some data structure which I can use that doesn't have any problems in storing as what arrays has.

My code:
while (<$outFile>) { chomp; $lno++; @line = split(/\t/, $_); ## $line[0] is for the first column push (@idmatrix, $line[0]) if (0 == $lno % 2){ ## Trying to store the even columns apart from the first c +olumn values } else if (1 == $lno % 2){ ## Trying to store the odd columns apart from the first co +lumn values } } } shift @idmatrix; ## To delete the first row (Is there any other way to ## delete the first row of the file)

Thanks. <\p>


In reply to Extract the odd and even columns seperately in the hash of arrays or some other data structure apart from arrays by snape

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.