That ran(I am on Solaris), but something still isn't quite right. The record length before adding the date is fixed 750 characters. I need the date added to every line, including the header, to making each record 758 characters fixed. Below is the beginning and end of the record of the first few lines in the file. You can see the date is not added to the beginning of the header record, which throws off the record length/wrapping of all subsequent records. The 'X' indicates the end of the record and should be in position 758 with the date added. Then each record after the header should start '20110705EB'. I can also see the 20110705 date added to each record(except the header), but it seems to be added somewhere in the middle of the record.
I have a flat file and need to count no of records in the file less the header and the trailer record.
I would appreciate any and all asistance
Thanks
Hadi Lalani (2 Replies)
Hi everyone,
I am new to Unix programming. My inquries is:-
a) How to add a Header and Trailer in the set of data
b) Include a number count of the data in the trailer
The set of data only contained the information of 'Customer's Name' and 'Account Number'. I would like to add the Header... (2 Replies)
One of the fortunate things about posting in a "Dummies" forum is you probably aren't expecting a lot of out me...
I'm trying to pull fields from two lines in the same file(s), and then append them together in a new file.
So...I get a nice line-by-line of the first bit of data I'm looking... (6 Replies)
Hi All,
I have got a requirement.
I have a source file, EMPFULL.txt and I need to split the data for every 30 records
and place a Typical Header as below with system and page number too.
2012.01.03 Employee Dept Report 1... (6 Replies)
I'm using a shell script to manipulate a data file. I have a large file with two sets of data samples (tracking memory consumption) taken over a long period of time, so I have many samples. The problem is that all the data is in the same file so that each sample contains two sets of data.... (2 Replies)
I have one file with below entry. There are multiple entries, but for sample I used just three lines.
my requirment is to create a script by which it will pull only those entries which modification time is greater than 2 weeks (or 15 days). if I run script today, it will compare date from today... (4 Replies)
HI,
Can anyone tell me how to pull the date and file name separated by a space using the find command or any other command. I want to look through several directories and based on a date timeframe (find -mtime -7), output the file name (without the path) and the date(in format mmddyyyy) to a... (2 Replies)
Hi,
I am using Sun Solaris - SunOS. I have two fixed width files shown below. I am trying to find the changes in the records in the Newfile.txt for the records where the key column matches. The first column is a key column (example: A123).
If there are any new or deletion of records in the... (4 Replies)
I have to append the header (ie "START OF LINE") to a file only if there is data in it.
Below command is showing header though there is no data in a file, can you suggest how to correct..
awk '{NR!=0} BEGIN{print "START OF LINE"}; {print}' file (3 Replies)
Discussion started by: JSKOBS
3 Replies
LEARN ABOUT DEBIAN
marc::file::microlif
MARC::File::MicroLIF(3pm) User Contributed Perl Documentation MARC::File::MicroLIF(3pm)NAME
MARC::File::MicroLIF - MicroLIF-specific file handling
SYNOPSIS
use MARC::File::MicroLIF;
my $file = MARC::File::MicroLIF->in( $filename );
while ( my $marc = $file->next() ) {
# Do something
}
$file->close();
undef $file;
EXPORT
None.
The buffer must be large enough to handle any valid record because we don't check for cases like a CR/LF pair or an end-of-record/CR/LF
trio being only partially in the buffer.
The max valid record is the max MARC record size(99999) plus one or two characters per tag (CR, LF, or CR/LF). It's hard to say what the
max number of tags is, so here we use 6000. (6000 tags can be squeezed into a MARC record only if every tag has only one subfield
containing a maximum of one character, or if data from multiple tags overlaps in the MARC record body. We're pretty safe.)
METHODS
in()
Opens a MicroLIF file for reading.
Gets the next chunk of data. If $want_line is true then you get the next chunk ending with any combination of
and
of any length. If
it is false or not passed then you get the next chunk ending with x60 followed by any combination of
and
of any length.
All trailing
and
are stripped.
header()
If the MicroLIF file has a file header then the header is returned. If the file has no header or the file has not yet been opened then
"undef" is returned.
decode()
Decodes a MicroLIF record and returns a USMARC record.
Can be called in one of three different ways:
$object->decode( $lif )
MARC::File::MicroLIF->decode( $lif )
MARC::File::MicroLIF::decode( $lif )
TODO RELATED MODULES
MARC::File
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::File::MicroLIF(3pm)