Hi,
I face difficulty where the number which I grep before I would like to use it as number to grep again in another file.
For example in file 1, I extract the second field and assign to variable "char" in a while loop. And then, I grep again this char to get i and j.
char=`echo "${LINE}"|... (17 Replies)
Hi,
What is a good way to read elements of an xml file? i did try xmllint it doesnt provide a function to output values of a tree. In the below example when i specify from Family2 I need the name of the father then the output should be DAVE. Appreciate any help provided in this regards.
Many... (6 Replies)
Hi,
I have this typical extraction problem in AWK.
I have 3 input files..
i) First one is somehow like an oracle of:-
foo 12,23,24
bla 11,34
car 35
ii)Second file is basically detailing the score for each of the second field of first file. Besides, for the first column, it is the... (3 Replies)
I'm trying to write a script to help automate some VERY tedious manual tasks.
I have groups of fairly large XML files (~3mb+) that I need to edit.
I need to look through the files and parse the XML looking for a certain flag contained in a field. If I find this flag (an integer value) I need... (4 Replies)
Hi Techies,
I got struck in middle of a problem. I have the following data whose format is:
a 1
a 2
a 3
a 4
b 1
b 2
b 3
b 4
c 1
c 2
c 3
c 4
I wanted the output from this to be:
a 3
a 4 (11 Replies)
Hi Friends
Im so confused with using 'for' loop in ksh. I have a xml like the following:
<serviceProvider>
<serviceProviderID>1</serviceProviderID>
<serviceProviderName>Balesh</serviceProviderName>
<serviceFeeAmount>30.00</serviceFeeAmount>
</serviceProvider>... (2 Replies)
HI All,
I have to split a xml file into multiple xml files and append it in another .xml file. for example below is a sample xml and using shell script i have to split it into three xml files and append all the three xmls in a .xml file. Can some one help plz.
eg:
<?xml version="1.0"?>... (4 Replies)
Hello everybody,
I have a double mission with some XML files, which is pretty challenging for my actual beginner UNIX knowledge. I need to extract some strings from multiple XML files and create a new XML file with the searched strings..
The original XML files contain the source code for... (12 Replies)
Hi,
I have a requirement to extract specific element value dynamically from XML message.
Here is the sample message:
<File>
<List>
<main>
<dir>doc/store834/archive</dir>
<count>5</count>
</main>
<main>
<dir>doc/store834/extract</dir>
<count>6</count>
</main>
<main> ... (3 Replies)
Discussion started by: renukeswar
3 Replies
LEARN ABOUT REDHAT
xml::grove::sub
XML::Grove::Sub(3) User Contributed Perl Documentation XML::Grove::Sub(3)NAME
XML::Grove::Sub - run a filter sub over a grove
SYNOPSIS
use XML::Grove::Sub;
# Using filter method on XML::Grove::Document or XML::Grove::Element:
@results = $grove_object->filter(&sub [, ...]);
# Using an XML::Grove::Sub instance:
$filterer = XML::Grove::Sub->new();
@results = $grove_object->accept($filterer, &sub [, ...]);
DESCRIPTION
"XML::Grove::Sub" executes a sub, the filter, over all objects in a grove and returns a list of all the return values from the sub. The
sub is called with the grove object as it's first parameter and passing the rest of the arguments to the call to `"filter()"' or
`"accept()"'.
EXAMPLE
The following filter will return a list of all `"foo"' or `"bar"' elements with an attribute `"widget-no"' beginning with `"A"' or `"B"'.
@results = $grove_obj->filter(sub {
my $obj = shift;
if ($obj->isa('XML::Grove::Element')
&& (($obj->{Name} eq 'foo')
|| ($obj->{Name} eq 'bar'))
&& ($obj->{Attributes}{'widget-no'} =~ /^[AB]/)) {
return ($obj);
}
return ();
});
AUTHOR
Ken MacLeod, ken@bitsko.slc.ut.us
SEE ALSO perl(1), XML::Grove(3), Data::Grove::Visitor(3)
Extensible Markup Language (XML) <http://www.w3c.org/XML>
perl v5.8.0 1999-09-02 XML::Grove::Sub(3)