June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
19
Task/Text-processing-2/Perl-6/text-processing-2.pl6
Normal file
19
Task/Text-processing-2/Perl-6/text-processing-2.pl6
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
my $good-records;
|
||||
my $line;
|
||||
my %dates;
|
||||
|
||||
for lines() {
|
||||
$line++;
|
||||
/ ^
|
||||
(\d ** 4 '-' \d\d '-' \d\d)
|
||||
[ \h+ \d+'.'\d+ \h+ ('-'?\d+) ] ** 24
|
||||
$ /
|
||||
or note "Bad format at line $line" and next;
|
||||
%dates.push: $0 => $line;
|
||||
$good-records++ if $1.all >= 1;
|
||||
}
|
||||
|
||||
say "$good-records good records out of $line total";
|
||||
|
||||
say 'Repeated timestamps (with line numbers):';
|
||||
.say for sort %dates.pairs.grep: *.value.elems > 1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue