As a start here you have the code to get the lines that have both patterns following up including the subsequent lines.
To get the line above and below these blocks you can give a try yourself maybe. But I guess someone comes up with a complete solution soon
I have a file like this..
Maharastra Mumbai worli
Maharastra Mumbai navy
maharatra Pune
Maharastra Nagpur
Karnataka Bangalore
Karnataka Mysore
Karnataka Mangalore
Punjab Amritsar
punjab Jalandar
my expected outcome should be like this
Maharastra Mumbai worli
---------- ... (9 Replies)
Hi all,I am really new to Shell Scripting.I have the following doubt.
Let us assume the one sample file which contains the below data
HEADERCARMENTRACIE1555090414
PERIOD0905090501090531
DETAIL0645693037023073836
GROUNDAV 090501 01
GROUNDAV 090502 01
TRIP 0091282542 0905084101... (5 Replies)
I have my data something like this
I need to search for the keyword yyyy in the susequent lines and if it is present, delete the second line with keyword.
In other words, if a keywords is found in two subsequent lines delete the second line.
input data:
aaaa bbbbb cccc dddd
xxxx... (4 Replies)
Hi, I need to grep a pattern and fetch subsequent lines till end of the data-set.
E.g., i have a file like:
AA 1111 23 34
BB 45 56 78
CC 22 44
AA 2222 78 34 56
BB 22 56 67 68 23
CC 56 78
DD 33 55 77
AA 3333 46
BB 58 79
In above file i have 3-data sets where each set starts with... (6 Replies)
I've run into a problem getting exactly what I want out of awk - some folks may recognize this as an output from Amazon's ec2-describe-instances:
Given the following:
INSTANCE i-4960f321
BLOCKDEVICE Line2Var2
TAG instance i-4960f321 Name web1
TAG instance i-4960f321... (2 Replies)
Hi ,
I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code.
my $current_value=12345;
my @users=("bob","ben","tom","harry");
open DBLIST,"<","/var/tmp/DBinfo";
my @input = <DBLIST>;
foreach (@users)
{
my... (11 Replies)
Hi,
I have a requirement like, I have a list of pattens in a file say pattern.txt,
PHC111
PHC113
and in another file called master.lst i have entries like,
PHC111
a
b
PHC112
a
PHC113
b
c
PHC114
d
e (5 Replies)
Discussion started by: rbalaj16
5 Replies
LEARN ABOUT CENTOS
xml::grove::path
XML::Grove::Path(3) User Contributed Perl Documentation XML::Grove::Path(3)NAME
XML::Grove::Path - return the object at a path
SYNOPSIS
use XML::Grove::Path;
# Using at_path method on XML::Grove::Document or XML::Grove::Element:
$xml_obj = $grove_object->at_path("/some/path");
# Using an XML::Grove::Path instance:
$pather = XML::Grove::Path->new();
$xml_obj = $pather->at_path($grove_object);
DESCRIPTION
"XML::Grove::Path" returns XML objects located at paths. Paths are strings of element names or XML object types seperated by slash ("/")
characters. Paths must always start at the grove object passed to `"at_path()"'. "XML::Grove::Path" is not XPath, but it should become
obsolete when an XPath implementation is available.
Paths are like URLs
/html/body/ul/li[4]
/html/body/#pi[2]
The path segments can be element names or object types, the objects types are named using:
#element
#pi
#comment
#text
#cdata
#any
The `"#any"' object type matches any type of object, it is essentially an index into the contents of the parent object.
The `"#text"' object type treats text objects as if they are not normalized. Two consecutive text objects are seperate text objects.
AUTHOR
Ken MacLeod, ken@bitsko.slc.ut.us
SEE ALSO perl(1), XML::Grove(3)
Extensible Markup Language (XML) <http://www.w3c.org/XML>
perl v5.16.3 1999-08-17 XML::Grove::Path(3)