Created
June 20, 2013 02:13
-
-
Save JEEN/5819824 to your computer and use it in GitHub Desktop.
Usage: perl ascendoly.pl file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
open my $fh, "<", $ARGV[0] or die $!; | |
my $data; | |
while(<$fh>) { | |
s/[\r\n]//g; | |
my (undef, $id1, $id2) = split '\s+', $_; | |
push @{ $data->{$id2} }, $id1; | |
} | |
for my $key (sort keys %{ $data }) { | |
print join("\t", $key, @{ $data->{$key} })."\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment