6 # copy and paste raw text from acrobat reader to .txt file
8 my $filename = $ARGV[0];
9 open(my $fh, '<:encoding(UTF-8)', $filename)
10 or die "Could not open file '$filename' $!";
14 while (my $row = <$fh>) {
16 if ($row =~ m/Fines Due by patron/) { next; }
17 if ($row =~ m/Patron Title Barcode Date Due Fine/) { next; }
18 if ($row =~ m/Page: /) { next; }
19 if ($row =~ m/Program Files \(x86\)/) { next; }
20 if ($row =~ m/End Of Report/) { next; }
21 if ($row =~ m/Fines Due by Patron/) { next; }
23 my @str = split / /, $row;
24 my $str_length = scalar(@str);
25 if ($str[1] eq 'AM' or $str[1] eq 'PM') {
26 if ($str[2] =~ m/2019/) { next; }
29 if ($str[$str_length -1] !~ m/^\d*\.?\d*$/) {
30 $user = $str[$str_length -1];
35 if ($str[$str_length -1] =~ m/^\d*\.?\d*$/) {
36 my $f = $str[$str_length -1]; #fine
37 my $i = $str[$str_length -3]; #item barcode
38 print "$user\t$i\t$f\n";