install-eg.sh: fix setup of non-prod Apache includes
[sitka/sitka-tools.git] / marc_export_custom / stats.pl
CommitLineData
8ec81273
RJ
1#!/usr/bin/perl
2use MARC::Batch;
3use strict;
4use warnings;
5my $batch = MARC::Batch->new( 'USMARC', @ARGV );
6$batch->strict_off();
7$batch->warnings_off();
8my $count_raw = 0;
9my $count_901c = 0;
10while ( my $marc = $batch->next ) {
11 $count_raw++;
12 my $field_901c = $marc->subfield(901,"c");
13 if(defined $field_901c) {
14 chomp $field_901c;
15 $count_901c++ if ($field_901c =~ /^.+$/);
16 }
17}
18printf "Count (raw): %d\n",$count_raw;
19printf "Count (901c): %d\n",$count_901c;