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/Items On Loan by Patron/) { next; }
17 if ($row =~ m/Patron Title Barcode /) { next; }
18 if ($row =~ m/Page: /) { next; }
19 if ($row =~ m/Program Files \(x86\)/) { next; }
20 if ($row =~ m/End Of Report/) { next; }
22 my @str = split / /, $row;
23 my $str_length = scalar(@str);
24 if ($str[1] eq 'AM' or $str[1] eq 'PM') {
25 if ($str[2] =~ m/2019/) { next; }
28 if ($str[$str_length -1] !~ m/\d\d\/\d\d\/\d\d\d\d/) {
29 $user = $str[$str_length -1];
34 if ($str[$str_length -1] =~ m/\d\d\/\d\d\/\d\d\d\d/) {
35 my $due = $str[$str_length -1];
36 my $borrowed = $str[$str_length -2];
37 my $item = $str[$str_length -3]; #item
38 print "$user\t$item\t$due\t$borrowed\n";