Hi, I need to chope the header and footer record from an input file and make a new output file, please let me know how i can do it in unix.thanks. (4 Replies)
I am trying to get a total number of tapes w/out headers or footers in a ERV file and append it to the file. For some reason I cannot get it to work. Any ideas?
#!/bin/sh
dat=`date +"%b%d_%Y"`
+ date +%b%d_%Y
dat=Nov16_2006
tapemgr="/export/home/legato/tapemgr/rpts"... (1 Reply)
Hello gurus,
I have a file in a tab delimited format and a header row. I need a code to delete the header in the file, and convert the file to a fixed width format, with all the columns aligned. Below is a sample of the file:... (4 Replies)
I am having report file with header and footer . The details in between header and footer are separated by a pipe charater. I want to sort the file by considering multiple columns in between header and footer.
pls help (4 Replies)
This is my file(Target.txt)
name|age|locaction
abc|23|del
xyz|24|mum
jkl|25|kol
The file should be like this
1|03252012
1|name|age|location
2|abc|23|del
2|xyz|24|mum
2|jkl|25|kol
2|kkk|26|hyd
3|4
Column 1 is row indicator
for row 1 and 2, column indicator is 1,for data rows... (1 Reply)
Hi Every one,
what is the coomand to remove header or footer from a file.
Please help me by providing command/syntax to remove header/footer from unix.
Thanks in advance for all your support. (5 Replies)
HI Everyone,
I have below source file
AAA|NAME1|ADDRESS1|300.20
BBB|NAME2|ADDRESS2|400.31
CCC|NAME3|ADDRESS3|300.34
I have requirement where I need to sum up fourth field in above fixed width pipe delimited flat file. When I use below code, it gives me value 1001.00
But I am expecting... (1 Reply)
Hi Forum.
I have the following script that splits a large fixed-width file into smaller multiple fixed-width files based on input segment type.
The main command in the script is:
awk -v search_col_pos=$search_col_pos -v search_str_len=$search_str_len -v segment_type="$segment_type"... (8 Replies)
Discussion started by: pchang
8 Replies
LEARN ABOUT DEBIAN
xml::filter::sort::buffermgr
XML::Filter::Sort::BufferMgr(3pm) User Contributed Perl Documentation XML::Filter::Sort::BufferMgr(3pm)NAME
XML::Filter::Sort::BufferMgr - Implementation class used by XML::Filter::Sort
DESCRIPTION
The documentation is targetted at developers wishing to extend or replace this class. For user documentation, see XML::Filter::Sort.
Two classes are used to implement buffering records and spooling them back out in sorted order as SAX events. One instance of the
XML::Filter::Sort::Buffer class is used to buffer each record and one or more instances of the XML::Filter::Sort::BufferMgr class are used
to manage the buffers.
API METHODS
The API of this module as used by XML::Filter::Sort::Buffer consists of the following sequence of method calls:
1. When the first 'record' in a sequence is encountered, XML::Filter::Sort creates a XML::Filter::Sort::BufferMgr object using the "new()"
method.
2. XML::Filter::Sort calls the buffer manager's "new_buffer()" method to get a XML::Filter::Sort::Buffer object and all SAX events are
directed to this object until the end of the record is encountered. The following events are supported by the current buffer
implementation:
start_element()
characters()
comment()
processing_instruction()
end_element()
3. When the end of the record is detected, XML::Filter::Sort calls the buffer manager's "close_buffer()" method, which in turn calls the
buffer's "close()" method. The "close()" method returns a list of values for the sort keys and the buffer manager uses these to store
the buffer for later recall. Subsequent records are handled as per step 2.
4. When the last record has been buffered, XML::Filter::Sort calls the buffer manager's "to_sax()" method. The buffer manager retrieves
each of the buffers in sorted order and calls the buffer's "to_sax()" method.
Each buffer attempts to match the sort key paths as SAX events are received. Once a value has been found for a given key, that same path
match is not attempted against subsequent events. For efficiency, the code to match each key is compiled into a closure. For even more
efficiency, this compilation is done once when the XML::Filter::Sort object is created. The "compile_matches()" method in the buffer
manager class calls the "compile_matches()" method in the buffer class to achieve this.
DATA STRUCTURES
In the current implementation, the XML::Filter::Sort::BufferMgr class simply uses a hash to store the buffer objects. If only one sort key
was defined, only a single hash is required. The values in the hash are arrayrefs containing the list of buffers for records with
identical keys.
If two or more sort keys are defined, the hash values will be XML::Filter::Sort::BufferMgr objects which in turn will contain the buffers.
The following illustration may clarify the relationship (BM=buffer manager, B=buffer):
BM
+----------------+---------------+
| |
BM BM
+-----+--------+ +-----+----------+
| | | |
BM BM BM BM
+-----+----+ +----+------+ +----+----+ +------+------+
| | | | | | | | | | | |
[B,B,B] [B] [B,B] [B] [B,B] [B,B,B] [B] [B,B] [B] [B,B] [B,B,B] [B,B]
This layered storage structure is transparent to the XML::Filter::Sort object which instantiates and interacts with only one buffer manager
(the one at the top of the tree).
COPYRIGHT
Copyright 2002 Grant McLean <grantm@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.4 2002-06-14 XML::Filter::Sort::BufferMgr(3pm)