I just tested it with
find(
sub {
return unless (/\.$doctype$/i);
my $year='';
local @ARGV = $_;
local $/ = "\n\n";
local $^I = '.bac';
while( <> ) {
if (/=099.*?(\d\d\d\d)\n/s) {
$year = $1;
s/(=099.*?)(\d\d\d\d)\n/$1\n/s...
Yes the date would only be in =099 and there is only one per record.
so to include \n before =099 did you mean this:
if (n\/=099.*?(\d\d\d\d)\n/s) {
$year = $1;
s/(\n=099.*?)(\d\d\d\d)\n/$1\n/s; (not sure if that one
is right)...
The code change didn't work. The file is actually just a text file so I think its just a CR. Here is an example of a 2 record file. (these aren't actually MARC records but text representations of them)
=LDR 00877nam 2200265 a 4500
=001 lbk00003424\
=005 20070829165504.0
=008...
Just tested that and its still returning the first record's date in all the other records.
Again I am stumped.
Any more help would be appreciated!
Thanks
darthjef.
Hi again brigmar. I spoke too soon. I actually need it to pick up the date for each individual record. The files to process contain a number of records each with a potentially different date in the 099 field
the script as it is grabs the date from the first record and then globally processes...
Thanks so much brigmar!
That is exactly what I want the script to do. the removal of the date from 099 I can handle from here.
Again thanks so much for the help.
darthjef
darthjef (TechnicalUser)
11 Sep 07 12:54
Perl regex questions for perl script using file::find
Hi Im having a problem getting my perl script to run properly. I'm new to perl and programming in general and am at a loss as to how to proceed.
I am trying to capture
a group variable ($1) from...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.