Skip to content

Instantly share code, notes, and snippets.

@JEEN
Created June 20, 2013 02:13
Show Gist options
  • Save JEEN/5819824 to your computer and use it in GitHub Desktop.
Save JEEN/5819824 to your computer and use it in GitHub Desktop.
Usage: perl ascendoly.pl file
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