3 # Copyright 2009-2012, Equinox Software, Inc.
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 # Converts a Unicorn users.data file to a tab-separated file of lost items.
21 # 2009-11-06 Ben Ostrowsky <ben@esilibrary.com>
29 # Title, Author, Call (or parts thereof)
39 # print STDERR "Loaded this line: " . $_;
41 if ( /^\.(.*?).\s+(\|a)?(.*)$/ ) {
43 if ($field eq 'USER_ID') {
44 if ($lostitem ne '') {
45 $lostitem =~ m/^(.*)copy:([^,]*),\s*ID:([^,]*),\s*due:(.*)$/;
46 print "$userid\t$3\t$2\t$4\t$1\n";
51 if ($field eq 'LOSTITEM') {
52 if ($lostitem ne '') {
53 $lostitem =~ m/^(.*)copy:([^,]*),\s*ID:([^,]*),\s*due:(.*)$/;
54 print "$userid\t$3\t$2\t$4\t$1\n";
61 # This is the continuation of the previous line.
64 if ($field eq 'LOSTITEM') { $lostitem .= $_; }