search a word and delete consecutive lines below it
Hi all coders,
I need a help to process some data.
I have this file,
What I need is to search a word "Selected" or "Page:" and delete that line as well as next 4 lines. These are the lines which are in bold.
Can we use sed here, actually I come across an example in which we can specify a line and delete next few lines from it.
delete few lines after a specific line
.
I am sure "sed/awk" can help me but not able to use, tried google and many hit and trials, but could not succeed.
Hi, I've been searching in this forum for the last 4 hours trying to do one thing: search 2 lines and delete the above line. So far I have not be able to find something similar in this forum, so I need help. This is what I'm trying to do. For example, I have a file called file1:
file1
word1... (4 Replies)
Hi,
Please suggest how to write a shell script which delets all the lines containing the word unix in the files supplied as argument in the shell. (4 Replies)
Let's say we have a file containing:
alllllsadfsdasdf
qwdDDDaassss
ccxxcxc#2222
dssSSSSddDDDD
D1Sqn2NYOHgTI
Hello
Alex
ssS@3
Ok, and let's say we want to delete all words from D1Sqn2NYOHgTI and back, this means
to delete the words (and the lines of them) :
alllllsadfsdasdf... (2 Replies)
Hi guys
I am deleting a unique line from the file and also need to remove the line above it which is NOT unique and servers as a record separator. Here is an example:
#
101 803E 823F 8240
#
102 755f 4F2A 4F2B
#
290 747D 0926 0927
#
999 8123 813E ... (5 Replies)
Hi,
I have to search a word in a text file and then I have to delete lines above from the word searched . For eg suppose the file is like this:
Records
P1
10,23423432
,77:1
,234:2
P2
10,9089004
,77:1
,234:2
,87:123
,9898:2
P3
456456
P1
:123,456456546
P2
abc:324234 (2 Replies)
hey guys,
I tried searching but most 'search and replace' questions are related to one liners.
Say I have a file to be replaced that has the following:
$ cat testing.txt
TESTING
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
ENDTESTING
This is the input file: (3 Replies)
HI group members
I am new in unix
I want to search # symbol in a file.
if found need to delete the entire row in the file.
need to move the actual data(with out # symbol data) to another file.
Thanks (2 Replies)
I have a text file that is about 90,000 lines long. How would I delete lines 64-89, 152-177, 240-265, 328-353... etc? The sections I would like to delete are 26 lines long and the number of lines between the sections I would like to delete is 62 lines. Thanks very much in advance. (6 Replies)
Hi, i have a file like this:
A1
kdfjdljfdkljfdlf
A2
lfjdlfkjddkjf
A3
***no hit***
A4
ldjfldjfdk
A5
***no hit***
A6
jldfjdlfjdlkfjd
I want to remove the lines "***no hit*** and their above line to get an output file like this: (11 Replies)
Hi
I have a text file like below. THe content of the text will vary.
Entire text file have four consecutive lines followed with blank line.
I want to delete the occurrence of the two consicutive lines in the text file. I don't have pattern to match and delete. Just i need to delete all... (5 Replies)
Discussion started by: RJSKR28
5 Replies
LEARN ABOUT SUSE
mail::dkim::policy
Mail::DKIM::Policy(3) User Contributed Perl Documentation Mail::DKIM::Policy(3)NAME
Mail::DKIM::Policy - abstract base class for originator "signing" policies
SYNOPSIS
# get all policies that apply to a verified message
foreach my $policy ($dkim->policies)
{
# the name of this policy
my $name = $policy->name;
# the location in DNS where this policy was found
my $location = $policy->location;
# apply this policy to the message being verified
my $result = $policy->apply($dkim);
}
DESCRIPTION
Between the various versions of the DomainKeys/DKIM standards, several different forms of sender "signing" policies have been defined. In
order for the Mail::DKIM library to support these different policies, it uses several different subclasses. All subclasses support this
general interface, so that a program using Mail::DKIM can support any and all policies found for a message.
METHODS
These methods are supported by all classes implementing the Mail::DKIM::Policy interface.
apply()
Apply the policy to the results of a DKIM verifier.
my $result = $policy->apply($dkim_verifier);
The caller must provide an instance of Mail::DKIM::Verifier, one which has already been fed the message being verified.
Possible results are:
accept
The message is approved by the sender signing policy.
reject
The message is rejected by the sender signing policy.
neutral
The message is neither approved nor rejected by the sender signing policy. It can be considered suspicious.
as_string()
The policy as a string.
Note that the string returned by this method will not necessarily have the tags ordered the same as the text record found in DNS.
is_implied_default_policy()
Is this policy implied?
my $is_implied = $policy->is_implied_default_policy;
If you fetch the policy for a particular domain, but that domain does not have a policy published, then the "default policy" is in effect.
Use this method to detect when that happens.
location()
Where the policy was fetched from.
This is generally a domain name, the domain name where the policy was published.
If nothing is published for the domain, and the default policy was returned instead, the location will be "undef".
name()
Identify what type of policy this is.
This currently returns strings like "sender", "author", and "ADSP". It is subject to change in the next version of Mail::DKIM.
SEE ALSO
Mail::DKIM::DkPolicy - for RFC4870(historical) DomainKeys sender signing policies
Mail::DKIM::DkimPolicy - for early draft DKIM sender signing policies
Mail::DKIM::AuthorDomainPolicy - for Author Domain Signing Practices (ADSP)
AUTHOR
Jason Long, <jlong@messiah.edu>
COPYRIGHT AND LICENSE
Copyright (C) 2006-2009 by Messiah College
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.6 or,
at your option, any later version of Perl 5 you may have available.
perl v5.12.1 2010-01-23 Mail::DKIM::Policy(3)