3 # Converts a Unicorn users.data file to a tab-separated file of lost items.
4 # 2009-11-06 Ben Ostrowsky <ben@esilibrary.com>
12 # Title, Author, Call (or parts thereof)
22 # print STDERR "Loaded this line: " . $_;
24 if ( /^\.(.*?).\s+(\|a)?(.*)$/ ) {
26 if ($field eq 'USER_ID') {
27 if ($lostitem ne '') {
28 $lostitem =~ m/^(.*)copy:([^,]*),\s*ID:([^,]*),\s*due:(.*)$/;
29 print "$userid\t$3\t$2\t$4\t$1\n";
34 if ($field eq 'LOSTITEM') {
35 if ($lostitem ne '') {
36 $lostitem =~ m/^(.*)copy:([^,]*),\s*ID:([^,]*),\s*due:(.*)$/;
37 print "$userid\t$3\t$2\t$4\t$1\n";
44 # This is the continuation of the previous line.
47 if ($field eq 'LOSTITEM') { $lostitem .= $_; }