12-02-2008
comparing part of header with part of detailed records.
Hi there,
I am lil confused with the following issue.
I have a File, which has the following header: IMSHRATE_043008_101016
a sample detailed record is :9820101 A982005000CAVG030108000000000000010169000MAR 2008
9820102 MAR 2008 D030108
I need to compare the part of Header (it is highlighted in Red Font and its a DDMMYY format ) with the Part of Detailed record (its highlighted in Yellow font and its also DDMMYY format).
The problem is there are thousands of such detailed records (on an average 50000 records) in a single file. Can anyone help me in comparing those 'part of header' with the 'part of detailed record' highlightened in Red and Yellow font in above example ?
Regards,
Cmaroju
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
All,
I have a task to search through several hundred files and extract duplicate detail records and keep them grouped with their header record. If no duplicate detail record exists, don't pull the header. For example, an input file could look like this:
input.txt
HA
D1
D2
D2
D3
D4
D4... (17 Replies)
Discussion started by: run_eim
17 Replies
2. Shell Programming and Scripting
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)
Discussion started by: guiguy
2 Replies
3. UNIX for Dummies Questions & Answers
I did some searches, but couldn't really find what I'm looking for. I have a file formatted as below:
BOF ABC CO - XYZ COMM DATA OF 07/05/2011
EBA00000001 sdfa rtyus uyml
EBB00000001 54682 984w3
EBA00000002 mkiyuasdf 98234
I want to pull the date from the header record and add it... (4 Replies)
Discussion started by: keeferb
4 Replies
4. Shell Programming and Scripting
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)
Discussion started by: srk409
6 Replies
5. Shell Programming and Scripting
Hi,
I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this:
Name =A
xxxxxx
yyyyyy
zzzzzz
aaaaaa
bbbbbb
Value = 57
This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies
6. Shell Programming and Scripting
I need some help. I would like to read in a text file.
Take a variable such as ROW-D-01, compare it to what's in one line in the text file such as PROD/VM/ROW-D-01 and only input PROD/VM into a variable without the /ROW-D-01.
Is this possible? any help is appreciated. (2 Replies)
Discussion started by: xChristopher
2 Replies
7. Shell Programming and Scripting
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)
Discussion started by: abercrom
2 Replies
8. Shell Programming and Scripting
Hi Guru's,
i am creating a script that will update menu of either complete or failed.
#!/bin/bash
choice=0
while
do
echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""
echo " ###############################################"
echo " # Choose... (3 Replies)
Discussion started by: reignangel2003
3 Replies
9. UNIX for Beginners Questions & Answers
Hi,
I have a backup report that unfortunately has some kind of hanging indent thing where the first line contains one column more than the others
I managed to get the output that I wanted using awk, but just wanting to know if there is short way of doing it using the same awk
Below is what... (2 Replies)
Discussion started by: newbie_01
2 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
We've a VDI infrastructure in AWS (AWS workspaces) and we're planning to automate the process of provisioning workspaces. Instead of going to GUI console, and launching workspaces by selecting individual users is little time consuming. Thus, I want to create them in bunches from AWS CLI... (6 Replies)
Discussion started by: arun_adm
6 Replies
LEARN ABOUT DEBIAN
amanda-archive-format
AMANDA-ARCHIVE-FOR(5) File formats and conventions AMANDA-ARCHIVE-FOR(5)
NAME
amanda-archive-format - Format of amanda archive streams
DESCRIPTION
The Amanda archive format is designed to be a simple, efficient means of interleaving multiple simultaneous files, allowing an arbitrary
number of data streams for a file. It is a streaming format in the sense that the writer need not know the size of files until they are
completely written to the archive, and the reader can process the archive in constant space.
DATA MODEL
The data stored in an archive consists of an unlimited number of files. Each file consists of a number of "attributes", each identified by
a 16-bit ID. Each attribute can contain an unlimited amount of data.
Attribute IDs less than 16 (AMAR_ATTR_APP_START) are reserved for special purposes, but the remaining IDs are available for
application-specific uses.
STRUCTURE
RECORDS
A record can be either a header record or a data record. A header record serves as a "checkpoint" in the file, with a magic value that can
be used to recognize archive files.
A header record has a fixed size of 28 bytes, as follows:
28 bytes: magic string
The magic string is the ASCII text "AMANDA ARCHIVE FORMAT " followed by a decimal representation of the format version number (currently
'1'), padded to 28 bytes with NUL bytes.
A data record has a variable size, as follows:
2 bytes: file number
2 bytes: attribute ID
4 bytes: data size (N)
N bytes: data
The file number and attribute ID serve to identify the data stream to which this data belongs. The low 31 bits of the data size give the
number of data bytes following, while the high bit (the EOA bit) indicates the end of the attribute, as described below. Because records
are generally read into memory in their entirety, the data size must not exceed 4MB (4194304 bytes). All integers are in network byte
order.
A header record is distinguished from a data record by the magic string. The file number 0x414d, corresponding to the characters "AM", is
forbidden and must be skipped on writing.
Attribute ID 0 (AMAR_ATTR_FILENAME) gives the filename of a file. This attribute is mandatory for each file, must be nonempty, must fit in
a single record, and must precede any other attributes for the same file in the archive. The filename should be a printable string (ASCII
or UTF-8), to facilitate use of generic archive-display utilities, but the format permits any nonempty bytestring. The filename cannot span
multiple records.
Attribute ID 1 (AMAR_ATTR_EOF) signals the end of a file. This attribute must contain no data, but should have the EOA bit set.
CONNECTION TO DATA MODEL
Each file in an archive is assigned a file number distinct from any other active file in the archive. The first record for a file must have
attribute ID 0 (AMAR_ATTR_FILENAME), indicating a filename. A file ends with an empty record with ID 1 (AMAR_ATTR_EOF). For every file at
which a reader might want to begin reading, the filename record should be preceded by a header record. How often to write header records is
left to the discretion of the application.
All data records with the same file number and attribute ID are considered a part of the same attribute. The boundaries between such
records are not significant to the contents of the attribute, and both readers and writers are free to alter such boundaries as necessary.
The final data record for each attribute has the high bit (the EOA bit) of its data size field set. A writer must not reuse an attribute ID
within a file. An attribute may be terminated by a record containing both data and an EOA bit, or by a zero-length record with its EOA bit
set.
SEE ALSO
amanda(8), amanda(8)
The Amanda Wiki: : http://wiki.zmanda.com/
AUTHOR
Dustin J. Mitchell <dustin@zmanda.com>
Zmanda, Inc. (http://www.zmanda.com)
Amanda 3.3.1 02/21/2012 AMANDA-ARCHIVE-FOR(5)