Hi Kevin,
Thank you for the code, it worked with my file with the correct output. Well done.
I just wanted to learn how to use a hash of a hash, I am learning perl and trying to practise different ways of solving a problem. To be honest with you, I have always used arrays in perl, and never a hash of hash before, so wanted to try it but for this example dataset I became confused.
I could understand the...
User Profile
Collapse
-
0 A B C D E F G --> thousands more
A 1 0 5 1 2 3 1
B 6 0 2 1 1 1 1
C 1 0 2 1 2 1 1
D 2 0 1 2 1 1 1
E 1 1 0 1 1 1 1
F 0 1 0 1 2 1 9
G 0 1 3 2 1 1 1
thousands more
I have to go through the hash of a hash, so the top line is one hash ref and the column down the side is another. I have to pick each number is over 2, and the letter ref of the row and column are stated...Leave a comment:
-
I have this which is for a 2 column file that has been fed into a hash:- as I was looking at examples of hashes.
...Code:#!/usr/bin/perl -w use strict; use warnings; my $index1; my $index2; my %hashname; my $hashname; open (LIST1, "test.txt") || die "File not found\n"; while (<LIST1>) { ($index1, $index2) = split(/\t/,Leave a comment:
-
A bit more informations:-
I was reading the guidelines, and want to make it clear that I am not asking for code to be written for me. I am just confused as I am new and all the hash examples define the data within the perl code. I am just stating that my file is too large for that, so how do you define the keys and values, using the first row line and the first column. I am just confused by perl toy examples, as they do not show this...Leave a comment:
-
Large Matrix into a hash of a hash
Dear all,
I am new to Perl.
I have a large matrix. The easiest way to describe is it is like a calender where there are days along the top, numbers of weeks down the side, and the numbers of dates in the rest of the table.
Imagine this calendar to be populated with different data but with the same concept, but more like 10,000s across and 10,000s down. How would I parse this huge dataset into a hash. I...
No activity results to display
Show More
Leave a comment: