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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |