Hi I have an XML output like :
The XML output will be stored in a file called $output:
system("$resub_path -stdin < $input_xml_file >$output");
I need to grep the values of the fields 'inclUnits' ,'inclUnitsUsed','shared' (in Bold)for each accumId i.e., for '269','270' from the output file.
I have these values stored in an array ('269','270').
Can anyone help me in grepping the above mentioned corresponding filelds for each accumid from the $output file and store them in variables?
It is somewhat complex, but it will handle correctly formed XML strings.
What if for some valid reason some "field" you expect to key off of is missing? grep may break. An xml parser won't.
It is somewhat complex, but it will handle correctly formed XML strings.
What if for some valid reason some "field" you expect to key off of is missing? grep may break. An xml parser won't.
Is there anyway I can use grep for fetching those fields from output.
I don't need all those values to be fetched.
let's say from the output,I need to fetch the fields for only accumId='269' i.e., I need to fetch the values 'inclUnits','inclUnitsUsed','shared' for accumId='269' and need to store them in three different variables.
is it possible to do so ?Please help me if it can be done with grep.
I have just used the code you have given in a sample perl file,while compiling it is throwing some error,I'm unable to figure out them.can you please help me fixing these errors:
Thankyou verymuch
It worked for me
and one more thing...can I be able to perform integer operations like division on these fetched values? or need to do typecast or something like that ?
Hi,
Need help with parsing xml data in unix and place it in a csv file. My xml file looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<iwgroups>
<nextid value="128">
</nextid>
<iwgroup name="RXapproval" id="124" display-name="RXapproval"... (11 Replies)
I am trying to parse the XML Google contact file using tools like xmllint and I even dived into the XSL Style Sheets using xsltproc but I get nowhere.
I can not supply any sample file as it contains private data but you can download your own contacts using this script:
#!/bin/sh
# imports... (9 Replies)
for some reasons, i need to parse the XML result by using perl.
for instance, this is a sample XML result:
<Response>
<status>success</status>
<answer>AAA::AAA</answer>
<answer>BBB::BBB</answer>
</Response>
then i can use this way :
my @output = ();
foreach my $parts (@all) ##@all... (2 Replies)
Hello!
We need to parse weblogic config.xml file and display rows in format:
machine:listen-port:name:application_name
In our enviroment the output should be (one line for every instance):
Crm-Test-Web:8001:PIA:peoplesoft
Crm-Test-Web:8011:PIA:peoplesoft... (9 Replies)
I have a bash script that needs to read input from an XML file, which includes varying numbers of a certain type of child node. I want to be able to iterate through all the child nodes of a given parent. I installed the Perl XML-XPath package from
search.cpan.org. Once it's installed, from bash,... (4 Replies)
Well I have read several threads on the subject ... but being a newbie like me makes it hard to understand ...
What I need is the following:
Input data:
------- snip ---------
<FavouriteLocations> <FavouriteLocations class="FavouriteList"><Item... (6 Replies)
******************PERL VERSION************************
This is perl, v5.8.1 built for i386-linux-thread-multi
ERROR!!!!---Undefined subroutine &main::start called at /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/XML/Parser/Expat.pm line 469.
*********************PERL... (1 Reply)
I have a PERL script from which I need to make a HTTP request to Web Servlet (Essentially a URL with variables and values like &Variable1=AAAAAA&Variable2=BBBBBBBBB&Variable3=CCCCCCC). The Web servlet returns an XML result which needs to be parsed for the contents of the result within the program.... (15 Replies)