Hi, s/\n.* / :: /p means replace everything in the line buffer between the first linefeed and the last space with " :: " and print the result.
So for the first match the line buffer will contain the following after the 3 N-operations:
so \nPKG= P8SDB disks: \n-----------------------------------------------------------------------------------------------\n/dev/rdisk/disk7777 xx 00 00 xxxx 07:67 xxxx
will get replaced.. (\n is representation of the linefeed in this example)
Last edited by Scrutinizer; 01-31-2013 at 07:32 PM..
First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Hi all!
I have a data set in this tab separated format : Label, Value1, Value2
An instance is "data.txt" :
0 1 1
-1 2 3
0 2 2
I would like to parse this data set and generate two files, one that has only data with the label 0 and the other with label -1, so my outputs should be, for... (1 Reply)
Hello:
I am working parsing a large input file which will be broken down into multiples based on the second field in the file, in this case: STORE.
The idea is to create each file with the corresponding store number, for example: Report_$STORENUM_$DATETIMESTAMP , and obtaining the... (7 Replies)
i run command that return this result,example :
gigabitethernet2/2/4:NotPresent, gigabitethernet2/1/17:UP, gigabitethernet2/1/10:UP, gigabitethernet2/1/5:UP,
gigabitethernet2/1/9:UP, gigabitethernet2/1/36:DOWN, gigabitethernet2/1/33:DOWN, gigabitethernet2/1/8:UP,... (19 Replies)
I am trying to parse the input in awk to include the |gc= in $4 but am not able to. The below is close:
awk so far:
awk '{sub(/\|]+]++/, ""); print }' input.txt Input
chr1 955543 955763 AGRN-6|pr=2|gc=75 0 +
chr1 957571 957852 AGRN-7|pr=3|gc=61.2 0 +
chr1 970621 ... (7 Replies)
I am trying to look for $2 of file1 (skipping the header) in $2 of file2 (skipping the header) and if they match and the value in $10 is > 30 and $11 is > 49, then print the line from file1 to a output file. If no match is foung the line is not printed. Both the input and output are tab-delimited.... (3 Replies)
Hi Team,
Could you please help me with the below scenario.
I have a file which is in the below format.
Zipcode,001,001f,002,002f,003,003f,004,004f,005,005f,006,006f,007,007f
0050, ,0, ,0, ,0, ,1,*,7, ,7, ,7
0060, ,0, ,0, ,7, ,0,*,7, ,0, ,0
Would need the output as below.
First field... (1 Reply)
Hi,
So awk is driving me crazy on this one. I have searched everywhere and read man, docs and every related post Google can find and still no luck. The actual files I need to run this on are sensitive in nature, but it is the same thing as if I needed to calculate weighted grades for multiple... (15 Replies)
Discussion started by: cotilloe
15 Replies
LEARN ABOUT DEBIAN
courier::filter::module::header
Courier::Filter::Module::Header(3pm) User Contributed Perl Documentation Courier::Filter::Module::Header(3pm)NAME
Courier::Filter::Module::Header - Message header filter module for the Courier::Filter framework
SYNOPSIS
use Courier::Filter::Module::Header;
my $module = Courier::Filter::Module::Header->new(
fields => \%patterns_by_field_name,
response => $response_text,
logger => $logger,
inverse => 0,
trusting => 0,
testing => 0,
debugging => 0
);
my $filter = Courier::Filter->new(
...
modules => [ $module ],
...
);
DESCRIPTION
This class is a filter module class for use with Courier::Filter. It matches a message if one of the message's header fields matches the
configured criteria.
Constructor
The following constructor is provided:
new(%options): returns Courier::Filter::Module::Header
Creates a new Header filter module.
%options is a list of key/value pairs representing any of the following options:
fields
Required. A reference to a hash containing the message header field names and patterns (as key/value pairs) that messages are to
be matched against. Field names are matched case-insensitively. Patterns may either be simple strings (for exact, case-sensitive
matches) or regular expression objects created by the "qr//" operator (for inexact, partial matches).
So for instance, to match any message from the "debian-devel" mailing list with the subject containing something about 'duelling
banjoes', you could set the "fields" option as follows:
fields => {
'list-id' => '<debian-devel.lists.debian.org>',
subject => qr/duell?ings+banjoe?s?/i
}
response
A string that is to be returned literally as the match result in case of a match. Defaults to "Prohibited header value detected:
<field>: <value>".
All options of the Courier::Filter::Module constructor are also supported. Please see "new()" in Courier::Filter::Module for their
descriptions.
Instance methods
See "Instance methods" in Courier::Filter::Module for a description of the provided instance methods.
SEE ALSO
Courier::Filter::Module::Envelope, Courier::Filter::Module, Courier::Filter::Overview.
For AVAILABILITY, SUPPORT, and LICENSE information, see Courier::Filter::Overview.
AUTHOR
Julian Mehnle <julian@mehnle.net>
perl v5.14.2 2011-12-27 Courier::Filter::Module::Header(3pm)