I am doing KSH script to remove duplicate lines in a file. Let say the file has format below.
FileA
1253-6856
3101-4011
1827-1356
1822-1157
1822-1157
1000-1410
1000-1410
1822-1231
1822-1231
3101-4011
1822-1157
1822-1231
and I want to simply it with no duplicate line as file... (5 Replies)
I have a log file "logreport" that contains several lines as seen below:
04:20:00 /usr/lib/snmp/snmpdx: Agent snmpd appeared dead but responded to ping
06:38:08 /usr/lib/snmp/snmpdx: Agent snmpd appeared dead but responded to ping
07:11:05 /usr/lib/snmp/snmpdx: Agent snmpd appeared dead but... (18 Replies)
Hi please help me how to remove duplicate lines in any file.
I have a file having huge number of lines.
i want to remove selected lines in it.
And also if there exists duplicate lines, I want to delete the rest & just keep one of them.
Please help me with any unix commands or even fortran... (7 Replies)
greetings,
i'm hoping there is a way to cat a file, remove duplicate lines and send that output to a new file. the file will always vary but be something similar to this:
please keep in mind that the above could be eight occurrences of each hostname or it might simply have another four of an... (2 Replies)
Hi,
I have two files with below data::
file1:-
123|aaa|ppp
445|fff|yyy
999|ttt|jjj
555|hhh|hhh
file2:-
445|fff|yyy
555|hhh|hhh
The records present in file1, not present in file 2 should be writtent to the out put file.
output:-
123|aaa|ppp
999|ttt|jjj
Is there any one line... (3 Replies)
Hey guys, need some help to fix this script. I am trying to remove all the duplicate lines in this file.
I wrote the following script, but does not work. What is the problem?
The output file should only contain five lines:
Later! (5 Replies)
hi,
Please help me to write a command to delete duplicate lines from a file. And the size of file is 50 MB. How to remove duplicate lins from such a big file. (6 Replies)
Dear community,
I have to remove duplicate lines from a file contains a very big ammount of rows (milions?) based on 1st and 3rd columns
The data are like this:
Region 23/11/2014 09:11:36 41752
Medio 23/11/2014 03:11:38 4132
Info 23/11/2014 05:11:09 4323... (2 Replies)
Hi, all
I have a csv file that I would like to remove duplicate lines based on 1st field and sort them by the 1st field. If there are more than 1 line which is same on the 1st field, I want to keep the first line of them and remove the rest. I think I have to use uniq or something, but I still... (8 Replies)
Discussion started by: refrain
8 Replies
LEARN ABOUT DEBIAN
courriel::headers
Courriel::Headers(3pm) User Contributed Perl Documentation Courriel::Headers(3pm)NAME
Courriel::Headers - The headers for an email part
VERSION
version 0.29
SYNOPSIS
my $email = Courriel->parse( text => ... );
my $headers = $email->headers;
print "$_
" for $headers->get('Received');
DESCRIPTION
This class represents the headers of an email.
Any sub part of an email can have its own headers, so every part has an associated object representing its headers. This class makes no
distinction between top-level headers and headers for a sub part.
Each individual header name/value pair is represented internally by a Courriel::Header object. Some headers have their own special
subclass. These are:
o Content-Type
This is stored as a Courriel::Header::ContentType object.
o Content-Disposition
This is stored as a Courriel::Header::Disposition object.
API
This class supports the following methods:
Courriel::Headers->parse( ... )
This method creates a new object by parsing a string. It accepts the following parameters:
o text
The text to parse. This can either be a plain scalar or a reference to a scalar. If you pass a reference, the underlying scalar may be
modified.
o line_sep
The line separator. This default to a "
", but you can change it if necessary. Note that this only affects parsing, header objects
are always output with RFC-compliant line endings.
Header parsing unfolds folded headers, and decodes any MIME-encoded values as described in RFC 2047. Parsing also decodes header attributes
encoded as described in RFC 2231.
Courriel::Headers->new( headers => [ ... ] )
This method creates a new object. It accepts one parameter, "headers", which should be an array reference of header names and values.
A given header key can appear multiple times.
This object does not (yet, perhaps) enforce RFC restrictions on repetition of certain headers.
Header order is preserved, per RFC 5322.
$headers->get($name)
Given a header name, this returns a list of the Courriel::Header objects found for the header. Each occurrence of the header is returned as
a separate object.
$headers->get_values($name)
Given a header name, this returns a list of the string values found for the header. Each occurrence of the header is returned as a separate
string.
$headers->add( $name => $value )
Given a header name and value, this adds the headers to the object. If any of the headers already have values in the object, then new
values are added after the existing values, rather than at the end of headers.
The value can be provided as a string or a Courriel::Header object.
$headers->unshift( $name => $value )
This is like "add()", but this pushes the headers onto the front of the internal headers array. This is useful if you are adding "Received"
headers, which per RFC 5322, should always be added at the top of the headers.
The value can be provided as a string or a Courriel::Header object.
$headers->remove($name)
Given a header name, this removes all instances of that header from the object.
$headers->replace( $name => $value )
A shortcut for calling "remove()" and "add()".
The value can be provided as a string or a Courriel::Header object.
$headers->as_string( skip => ...., charset => ... )
This returns a string representing the headers in the object. The values will be folded and/or MIME-encoded as needed.
The "skip" parameter should be an array reference containing the name of headers that should be skipped. This parameter is optional, and
the default is to include all headers.
The "charset" parameter specifies what character set to use for MIME-encoding non-ASCII values. This defaults to "utf8". The charset name
must be one recognized by the Encode module.
MIME encoding is always done using the "B" (Base64) encoding, never the "Q" encoding.
$headers->stream_to( output => $output, skip => ...., charset => ... )
This method will send the stringified headers to the specified output.
See the "as_string()" method for documentation on the "skip" and "charset" parameters.
ROLES
This class does the "Courriel::Role::Streams" role.
AUTHOR
Dave Rolsky <autarch@urth.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2012 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
perl v5.14.2 2012-03-07 Courriel::Headers(3pm)