Why don't you try this:
open(STATES,"state.txt")||die "can't open file";
while (<STATES>) {
($mykey, $myval) = split /\s+/, $_;
$myhash{$mykey} .= $myval.', ';
}
close STATES;
# Let's write the output
foreach $loopkey (keys %myhash) {
$myhash{$loopkey }=~s/,\s$//; # Remove last comma and space
print $loopkey.' '.$myhash{$loopkey}."\n";
}
Ciao...
Alessandro Cavallari
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- Re: reading a text file Bill Allen
- Re: reading a text file Jos I. Boumans
- Re: reading a text file Jos I. Boumans
- Re: reading a text file Abdulaziz Ghuloum
- Re: reading a text file Boris Zentner
- Re: reading a text file John Fox
- RE: reading a text file Will Crain
- RE: reading a text file Wagner-David
- RE: reading a text file Bob Showalter
- RE: reading a text file Wagner-David
- RE: reading a text file acavallari
- RE: reading a text file Qiang Qiang
- RE: reading a text file Will Crain
- reading a text file Biju Ramachandran
- RE: reading a text file Dan Muey
- RE: reading a text file Biju Ramachandran
