Perl error in batch command but works one at a time
In the below perl executes if one file is processed perfect. However, when multiple files are processed in batch which is preferred I get the below error that I can not seem to fix it as the '' necessary for the command to execute, but seem to only work for one -arg option. Thank you .
command to process one file at a time
Using a batch command I get:
Batch command to process all files in target.txt
Last edited by cmccabe; 02-02-2017 at 09:52 AM..
Reason: fixed format, added details
Hi,
while running the perl script i am getting this error message ,
Day '' out of range 1..31 at rsty.sh line 44
what do iam missing in the script, any suggestion
#!/usr/bin/perl
use Time::Local;
my $wday = $ARGV;
my $month = $ARGV;
# convert the month shortname into 0-11 number
if... (4 Replies)
This just started happening.
I use the rcp command to copy a file from one server to another.
Now when I use the command, every other time I execute the exact same command I get the error: remshd: login correct
Example:
1. rcp testfile server2:/db/tmp (Work ok, verified file... (6 Replies)
so in unix this command works works and shows me a list of directories
find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt
but when i try running a perl script to run this command
my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
I have a script which outputs some timing data a line at a time. There are approx. 10 lines echoed, each line looks something like this:
0.741 http://checkip.dyndns.org 94.170.119.226Since I needed to add all the values in the first column, I piped the output to grep, matching and printing the... (7 Replies)
Hi All,
This command works when I type it on but when I run the batch file it doesn't..any ideas why?
attrib.exe * | find /c /v "" >filecount.txt (1 Reply)
Hi
I have an ftp script which works fine when i execute through a test scheduler(UC4), but when i run it through the prod scheduler(UC4), it hungs indefinetely, when we cancel the job and re-run it it works perfectly fine. here is the code,, any idea why this is happening ????
... (1 Reply)
I would like to be able to display the local time (or anytime for that matter) when I run Xentop in batch mode. Is that possible? (In other words, when I look back at the data, I want to be able to tell what time that the output was displayed). (2 Replies)
I ran this script yesterday (in the background)
/usr/bin/nohup myfilelocation/myscriptname.sh &
the script worked perfectly.
i ran it today (also in the background) and just sat there. So i killed it and ran it normally and it worked perfectly.
Anyone suggest why it just sat there and... (8 Replies)
Discussion started by: twinion
8 Replies
LEARN ABOUT DEBIAN
marc::batch
MARC::Batch(3pm) User Contributed Perl Documentation MARC::Batch(3pm)NAME
MARC::Batch - Perl module for handling files of MARC::Record objects
SYNOPSIS
MARC::Batch hides all the file handling of files of "MARC::Record"s. "MARC::Record" still does the file I/O, but "MARC::Batch" handles the
multiple-file aspects.
use MARC::Batch;
# If you have werid control fields...
use MARC::Field;
MARC::Field->allow_controlfield_tags('FMT', 'LDX');
my $batch = MARC::Batch->new( 'USMARC', @files );
while ( my $marc = $batch->next ) {
print $marc->subfield(245,"a"), "
";
}
EXPORT
None. Everything is a class method.
METHODS
new( $type, @files )
Create a "MARC::Batch" object that will process @files.
$type must be either "USMARC" or "MicroLIF". If you want to specify "MARC::File::USMARC" or "MARC::File::MicroLIF", that's OK, too.
"new()" returns a new MARC::Batch object.
@files can be a list of filenames:
my $batch = MARC::Batch->new( 'USMARC', 'file1.marc', 'file2.marc' );
Your @files may also contain filehandles. So if you've got a large file that's gzipped you can open a pipe to gzip and pass it in:
my $fh = IO::File->new( 'gunzip -c marc.dat.gz |' );
my $batch = MARC::Batch->new( 'USMARC', $fh );
And you can mix and match if you really want to:
my $batch = MARC::Batch->new( 'USMARC', $fh, 'file1.marc' );
next()
Read the next record from that batch, and return it as a MARC::Record object. If the current file is at EOF, close it and open the next
one. "next()" will return "undef" when there is no more data to be read from any batch files.
By default, "next()" also will return "undef" if an error is encountered while reading from the batch. If not checked for this can cause
your iteration to terminate prematurely. To alter this behavior, see "strict_off()". You can retrieve warning messages using the
"warnings()" method.
Optionally you can pass in a filter function as a subroutine reference if you are only interested in particular fields from the record.
This can boost performance.
strict_off()
If you would like "MARC::Batch" to continue after it has encountered what it believes to be bad MARC data then use this method to turn
strict OFF. A call to "strict_off()" always returns true(1).
"strict_off()" can be handy when you don't care about the quality of your MARC data, and just want to plow through it. For safety,
"MARC::Batch" strict is ON by default.
strict_on()
The opposite of "strict_off()", and the default state. You shouldn't have to use this method unless you've previously used "strict_off()",
and want it back on again. When strict is ON calls to next() will return undef when an error is encountered while reading MARC data.
strict_on() always returns true(1).
warnings()
Returns a list of warnings that have accumulated while processing a particular batch file. As a side effect the warning buffer will be
cleared.
my @warnings = $batch->warnings();
This method is also used internally to set warnings, so you probably don't want to be passing in anything as this will set warnings on your
batch object.
"warnings()" will return the empty list when there are no warnings.
warnings_off()
Turns off the default behavior of printing warnings to STDERR. However, even with warnings off the messages can still be retrieved using
the warnings() method if you wish to check for them.
"warnings_off()" always returns true(1).
warnings_on()
Turns on warnings so that diagnostic information is printed to STDERR. This is on by default so you shouldn't have to use it unless you've
previously turned off warnings using warnings_off().
warnings_on() always returns true(1).
filename()
Returns the currently open filename or "undef" if there is not currently a file open on this batch object.
RELATED MODULES
MARC::Record, MARC::Lint
TODO
None yet. Send me your ideas and needs.
LICENSE
This code may be distributed under the same terms as Perl itself.
Please note that these modules are not products of or supported by the employers of the various contributors to the code.
AUTHOR
Andy Lester, "<andy@petdance.com>"
perl v5.10.1 2010-03-29 MARC::Batch(3pm)