-
-
Save yath/1205777 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use 5.012.0; | |
my $dir; | |
my $file; | |
my %x; | |
while (<>) { | |
chomp; | |
if (/^$/) { | |
next; | |
} elsif (/^([^ ].*)/) { | |
$dir = $1; | |
} elsif (/^ ([^ ].*)/) { | |
$file = $1; | |
} elsif (/^ \[([OT])\] (.*)/) { | |
push @{$x{"res/$dir"}->{$1}}, $2; | |
} else { | |
die "Unknown line: $_"; | |
} | |
} | |
foreach my $file (sort keys %x) { | |
foreach my $type (sort keys %{$x{$file}}) { | |
local $, = "\t"; | |
say $file, $type, join("|", map { qq("$_") } @{$x{$file}->{$type}}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment