Link to home
Start Free TrialLog in
Avatar of plennon
plennon

asked on

hash tables

I have a .dat file which contains many line of data
i have split the line up using split() and i am wanting to read line[5] which contains a name and line[1] which contains it's value.
i want to read them into a hash table, then output them to file

how do i store the 2 values into a hash table and output them to a file in the following format

name, value
name, value
name, value


I know very little about hash tables so any feedback will be appreciated
ASKER CERTIFIED SOLUTION
Avatar of rootkiddy
rootkiddy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@line=split(/your-pattern/, $inputfromdat);
$input{$line[5]}=$line[1];
# output hash to file, see previous suggestion