Sponsored Content
Full Discussion: General Purpose Date Script
Top Forums UNIX for Beginners Questions & Answers General Purpose Date Script Post 302884075 by Corona688 on Friday 17th of January 2014 10:29:20 AM
Old 01-17-2014
warnings and strict added, errors corrected. v0.0.6 now.

Last edited by Corona688; 01-17-2014 at 11:42 AM..
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Looking for a general purpose System Monitor

Does anyone have any scripts or suggestions on a general purpose Unix/Linux monitoring tool? (5 Replies)
Discussion started by: darthur
5 Replies

2. UNIX for Dummies Questions & Answers

whats the purpose of the following script?

whats the purpose of the following script? who could run it? To what is the script refering that exceeds 75%? The mailbox? What does sed 's/%//' do? (1 Reply)
Discussion started by: vrn
1 Replies

3. Shell Programming and Scripting

General Q: how to run/schedule a php script from cron jobs maybe via bash from shell?

Status quo is, within a web application, which is coded completely in php (not by me, I dont know php), I have to fill out several fields, and execute it manually by clicking the "go" button in my browser, several times a day. Thats because: The script itself pulls data (textfiles) from a... (3 Replies)
Discussion started by: lowmaster
3 Replies

4. Shell Programming and Scripting

awk (?) help or just general script

I have two files (___ represents blanks) Foo1 1000 345 456 1001 876 908 1002 ___ 786 1003 643 908 1004 345 234 and Foo2 1000 345 1001 876 1002 111 1003 643 1004 345 (3 Replies)
Discussion started by: garethsays
3 Replies

5. Shell Programming and Scripting

script to fill up disk space for testing purpose

Hello everyone I am new to this forum I am working on a project and needed a test script to fill up a disk partition /tmp/data to see how the program fails. The system I am working on is a redhat 5.3. Is there anything out there? Thanks. (10 Replies)
Discussion started by: dp100022
10 Replies

6. UNIX for Dummies Questions & Answers

Purpose of - (hypen) in script or command line

Hi, I am new for unix and I am following ABS guide. What is the purpose of - (hypen ) in the below command and What it will do in this?. Can anyone explain it in detail. Rest of the things in the below command I understood somewhat. (cd /source/directory && tar cf - . ) | (cd /dest/directory &&... (1 Reply)
Discussion started by: gwgreen1
1 Replies

7. Shell Programming and Scripting

Script to determine Date,TotalFile,total size of file based on date

I have file listed like below -rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz -rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz -rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz -rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz -rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz I... (5 Replies)
Discussion started by: krish2014
5 Replies

8. UNIX for Beginners Questions & Answers

General Purpose XML Processing

I've been kicking this around for a while now, I might as well post it here. v0.0.9, now properly supporting self-closing tags. v0.0.8, an important quoting fix and a minor change which should handle special <? <!-- etc. tags without seizing up as often. Otherwise the code hasn't changed much.... (6 Replies)
Discussion started by: Corona688
6 Replies
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)
All times are GMT -4. The time now is 05:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy