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
sort::key::types
Sort::Key::Types(3pm) User Contributed Perl Documentation Sort::Key::Types(3pm)NAME
Sort::Key::Types - handle Sort::Key data types
SYNOPSIS
use Sort::Key::Types qw(register_type);
register_type(Color => sub { $_->R, $_->G, $_->B }, qw(int, int, int));
# you better
# use Sort::Key::Register ...
DESCRIPTION
The Sort::Key family of modules can be extended to support new key types using this module (or the more friendly Sort::Key::Register).
FUNCTIONS
The following functions are provided:
Sort::Key::register_type($name, &gensubkeys, @subkeystypes)
registers a new datatype named $name defining how to convert it to a multikey.
&gensubkeys should convert the object of type $name passed on $_ to a list of values composing the multikey.
@subkeystypes is the list of types for the generated multikeys.
For instance:
Sort::Key::Types::register_type
'Person',
sub { $_->surname,
$_->name,
$_->middlename },
qw(str str str);
Sort::Key::Types::register_type
'Color',
sub { $_->R, $_->G, $_->B },
qw(int int int);
Once a datatype has been registered it can be used in the same way as types supported natively, even for defining new types, i.e.:
Sort::Key::Types::register_type
'Family',
sub { $_->father, $_->mother },
qw(Person Person);
SEE ALSO
Sort::Key, Sort::Key::Merger, Sort::Key::Register.
COPYRIGHT AND LICENSE
Copyright (C) 2005-2007 by Salvador Fandin~o, <sfandino@yahoo.com>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or,
at your option, any later version of Perl 5 you may have available.
perl v5.14.2 2012-06-30 Sort::Key::Types(3pm)