Hi,
Im a new to perl and i hope there are people here that can help me!
I have a realy large file like this.
1,12,T,
2,13,B,
3,14,T,
4,15,B,
I want to use the 2nd and 3th column and put it into a hash like
with the 2nd column being the keys and the 3th column being the values.
This is what i have but i doesn't work!
open (data, 'data.csv');
my $hash_data = <data>;
my @hash_data = split (/,/, $hash_data);
@hash_Key = $hash_Data[1];
@hash_Values = $hash_Data[2];
%hash_data =($hash_Key => $hash_Values);
print %hash_data;
I hope someone can help me!
Iris
Im a new to perl and i hope there are people here that can help me!
I have a realy large file like this.
1,12,T,
2,13,B,
3,14,T,
4,15,B,
I want to use the 2nd and 3th column and put it into a hash like
with the 2nd column being the keys and the 3th column being the values.
This is what i have but i doesn't work!
open (data, 'data.csv');
my $hash_data = <data>;
my @hash_data = split (/,/, $hash_data);
@hash_Key = $hash_Data[1];
@hash_Values = $hash_Data[2];
%hash_data =($hash_Key => $hash_Values);
print %hash_data;
I hope someone can help me!
Iris
Comment