To list issues, do: LIST ONLOAN @ID FMT “15L” F1 OL.RDATE ID-SUPP HDR-SUPP COL-HDR-SUPP NOPAGE (log to file 'issues')

issuesprep.pl:

  1. !/usr/bin/perl -w
  2. ———————————–
  3. Script Name: issprep.pl
  4. Script Version: 1.0
  5. Date: 2003/6/5
  6. Author: Stephen Hedges
  7. Description: takes file of Spydus bad ONLOAN info
  8. and preps it for Koha.
  9. Invoke as: issprep.pl.
  10. Revision History:
  11. 1.0 2003/6/5: original version
  12. ———————————–

use strict;

my ($input,$accno,$borrno,$datedue,);

open(INFILE, “issues”); open(OUTFILE, ”>iss”);

LEAD: while (<INFILE>) {

  last LEAD if (/NOPAGE/);                     # test for word NOPAGE

} # gets rid of leading garbage LINE: while (<INFILE>) {

  last LINE if (/records listed/);             # stop before trailing garbage
  $input = crop($_);
  if ($input =~ /(\S+)\s+(\S+)\s+(\S+)/) {
      $accno = $1;
      $borrno = $2;
my @dates = split /\//, $3;
$datedue = "$dates[2]-$dates[0]-$dates[1]";
      print OUTFILE "$accno\t$borrno\t$datedue\n";
  }

}

close INFILE; close OUTFILE;

sub crop {

  my $line="";
  chomp $_[0];
  chop $_[0];                                  # raw data also has \r
  if ($_[0] =~ /\[H\[J/) {                 # strip cursor character
$line = "$`$'";
      } else {
      $line =$_[0];
  }
  return $line;

}

 
issuesdet.txt · Last modified: 2006/04/04 09:23 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki