On Thu, Jun 28, 2012 at 3:41 PM, lina <[email protected]> wrote:
> Hi,
>
> I have some data like:
>
> 0.35 3.41 1
> 0.35 4.24 1
> 0.35 4.35 2
> 0.36 0.36 1
> 0.36 1.32 1
> 0.36 1.45 1
> 0.36 1.46 1
>
>
> wish the output look like
>
> 0.36 1.32 1.45 1.46 3.41 4.24 4.35
> 0.35 0 0 0 0 1 1 2
> 0.36 1 1 1 1 0 0 0
>
> Thanks ahead for any suggestions,
I came up something which unable to make some strong sense, just my
first attempt
#!/usr/bin/env perl
use strict;
use warnings;
use autodie qw(open close);
use 5.012;
my $filename = "try_1";
my %x;
my %y;
open my $fh, '<', $filename;
while(<$fh>){
my @xyz = split ' ',$_;
$x{$xyz[0]} = $y{$xyz[1]} = $xyz[2];
}
Thanks again,
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/