<div class="gmail_quote">On Wed, Apr 13, 2011 at 3:34 PM, Bob Goodwin <span dir="ltr"><<a href="mailto:bobgoodwin@wildblue.net">bobgoodwin@wildblue.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I would like to write a script to extract two numbers from the following<br>
xml file:<br>
<br>
<graph caption="Customer: <a href="mailto:bobgoodwin@wildblue.net">bobgoodwin@wildblue.net</a>"<br>
xaxisname="Figures Shown Reflect Data Usage in the Last 30 Days"<br>
yAxisName="Data Usage" bgColor="E3ECF6" showGridBg="1"<br>
showCanvas="1" numdivlines="4" decimalPrecision="0"<br>
zeroPlaneColor="CCCCCC" zeroPlaneAlpha="40" numberSuffix="MB"><br>
<set name="Actual Usage Upload" value="1088" color="007CC2"/><br>
<set name="Usage Threshold Upload" value="5000" color="9CA279"/><br>
<set name="Actual Usage Download" value="12667" color="007CC2"/><br>
<set name="Usage Threshold Download" value="17000" color="9CA279"/><br>
</graph><br>
<br>
The two values I need are in this case the 1988 and the 12667.<br>
<br>
<set name="Actual Usage Download" value="12667" color="007CC2"/><br>
<br>
<set name="Actual Usage Upload" value="1088" color="007CC2"/><br>
<br>
<br>
I need to create a script I can run daily to check and record our usage<br>
in order to stay within our allocation. I can muddle through the rest<br>
but it would save me a lot of struggling if someone could show me how to<br>
do this part. My effort so far has not been productive!<font color="#888888"><a href="http://fedoraproject.org/wiki/Mailing_list_guidelines" target="_blank"></a><br>
</font></blockquote></div><br><br>Great timing! I have been struggling to get the xpath command line tool to do something similar with some xml I have. Can anyone solve Bob's question with xpath? I cannot for the life of me get the xpath syntax right.<br>
<br>Thanks from me too!<br clear="all"><br>-- <br>-jp<br><br>I'm not afraid of insects taking over the world, and you know why? It would
take about a billion ants just to AIM a gun at me, let alone fire it. And you
know what I'm doing while they're aiming it at me? I just sort of slip off to
the side, and then suddenly run up and kick the gun out of their hands.
<br><br><a href="http://deepthoughtsbyjackhandey.com">deepthoughtsbyjackhandey.com</a><br><br>