My data is xml'ish (here is an excerpt) :-
<bag name="mybag1" version="1.0"/>
<contents id="coins"/>
<bag name="mybag2" version="1.1"/>
<contents id="clothes"/>
<contents id="shoes"/>
<bag name="mybag3" version="1.6"/>
I want to delete line containing mybag2 and its subsequent... (5 Replies)
Hi!
From a file like this one :
hello
...
PATTERN1
...
lines between patterns
..
PATTERN2
...
I would like to extract only the lines between patterns, probably with awk I think?
Thanks a lot for your help,
Tipi (5 Replies)
Hi,
From the sample file below
Conditions
1) Pattern Range must start with "ALTER TABLE"
2) Pattern Range ends when it finds ";"
3) Between this range i want to select all the patterns that contain pattern " MOVE "
Note : I would like to exclude the above pattern matches and print... (1 Reply)
Hi,
Here is a sample of my Test File
$ cat TestFile1
Prompt Table DQZ_ALTER_SCHEMA_ID;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID MONITORING;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID STORAGE ( NEXT 3464K );
Prompt Table DQZ_ALTER_SCHEMA_ID;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID
MOVE LOB... (16 Replies)
Hi,
I have a file like below:
.
.
.
.
Jack is going home
Jack is going to school
Jack is sleeping
Jack is eating dinner
John is going home
John is eating breakfast
.
.
.
The specific line is:
Jack is going home (2 Replies)
Hi folks,
I have a file which contains several occurences of 2 different patterns. I need to find out the line of first occurence of pattern2 starting after the position of first occurence of pattern1.
example file:
aaaa
pattern2
bbbb
pattern1
ccc
pattern2
ddd
pattern1
eee
pattern2... (9 Replies)
Hi all!
How can I delete all the text starting from <string1> to <string2> in all the .txt files of the folder "FOLDER" ?
Thanks a lot!
mjomba
...
</s>
<s>
<w></w>
</s>
<s>
...
to get: (1 Reply)
Hello, I'm looking for sed solution to change
...
<li>keyword</li>
<li>keyword
<li>keyword</li>
<li>keyword
<li>keyword</li>
...
to
...
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
...
I.e., if lines beginning with <li> do not end with... (3 Replies)
I have the below 2 files:
1) Third field from file1.txt should be compared to the first field of lookup.txt.
2) If match found then third field, file1.txt should be substituted with the second field from lookup.txt.
3)Else just print the line from file1.txt.
File1.txt:... (4 Replies)
Version: RHEL 6.5
In the below text file, I want to find the lines which has the string JOHN , KATE and STEVE in it.
The logic is to grep with an AND condition ie. get all lines with JOHN AND KATE AND STEVE
$ cat sometext.txt
PHILIP worked in HR
JOHN along with KATE fixed several IT... (4 Replies)
Discussion started by: John K
4 Replies
LEARN ABOUT MOJAVE
xml::parser::style::stream
Parser::Style::Stream(3) User Contributed Perl Documentation Parser::Style::Stream(3)NAME
XML::Parser::Style::Stream - Stream style for XML::Parser
SYNOPSIS
use XML::Parser;
my $p = XML::Parser->new(Style => 'Stream', Pkg => 'MySubs');
$p->parsefile('foo.xml');
{
package MySubs;
sub StartTag {
my ($e, $name) = @_;
# do something with start tags
}
sub EndTag {
my ($e, $name) = @_;
# do something with end tags
}
sub Characters {
my ($e, $data) = @_;
# do something with text nodes
}
}
DESCRIPTION
This style uses the Pkg option to find subs in a given package to call for each event. If none of the subs that this style looks for is
there, then the effect of parsing with this style is to print a canonical copy of the document without comments or declarations. All the
subs receive as their 1st parameter the Expat instance for the document they're parsing.
It looks for the following routines:
o StartDocument
Called at the start of the parse .
o StartTag
Called for every start tag with a second parameter of the element type. The $_ variable will contain a copy of the tag and the %_
variable will contain attribute values supplied for that element.
o EndTag
Called for every end tag with a second parameter of the element type. The $_ variable will contain a copy of the end tag.
o Text
Called just before start or end tags with accumulated non-markup text in the $_ variable.
o PI
Called for processing instructions. The $_ variable will contain a copy of the PI and the target and data are sent as 2nd and 3rd
parameters respectively.
o EndDocument
Called at conclusion of the parse.
perl v5.18.2 2011-05-24 Parser::Style::Stream(3)