paper-cutter/{{cookiecutter.paper_repo_name}}/extract-score-files.pl
Filip Gralinski 67c788fe69 Init from an internal repo.
Commit d5b6f8e831fc5c933af5ceb1267f51ef6af6c438
2020-11-24 08:33:07 +01:00

21 lines
367 B
Perl
Executable File

#!/usr/bin/perl
use strict;
my %found = ();
for my $filepath (@ARGV) {
open(my $ih, '<', $filepath);
binmode($ih, ':utf8');
while (my $line=<$ih>) {
while ($line =~ m<\\gonito(?:barescore|score|entry)\{([^\}]+)\}>g) {
$found{$1} = 1;
}
}
close($ih);
}
print join(" ", map { "scores/${_}.txt" } sort keys %found);