<div class="gmail_quote">On Wed, Apr 13, 2011 at 3:34 PM, Bob Goodwin <span dir="ltr">&lt;<a href="mailto:bobgoodwin@wildblue.net">bobgoodwin@wildblue.net</a>&gt;</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>
        &lt;graph caption=&quot;Customer: <a href="mailto:bobgoodwin@wildblue.net">bobgoodwin@wildblue.net</a>&quot;<br>
        xaxisname=&quot;Figures Shown Reflect Data Usage in the Last 30 Days&quot;<br>
        yAxisName=&quot;Data Usage&quot; bgColor=&quot;E3ECF6&quot; showGridBg=&quot;1&quot;<br>
        showCanvas=&quot;1&quot; numdivlines=&quot;4&quot; decimalPrecision=&quot;0&quot;<br>
        zeroPlaneColor=&quot;CCCCCC&quot; zeroPlaneAlpha=&quot;40&quot; numberSuffix=&quot;MB&quot;&gt;<br>
        &lt;set name=&quot;Actual Usage Upload&quot; value=&quot;1088&quot; color=&quot;007CC2&quot;/&gt;<br>
        &lt;set name=&quot;Usage Threshold Upload&quot; value=&quot;5000&quot; color=&quot;9CA279&quot;/&gt;<br>
        &lt;set name=&quot;Actual Usage Download&quot; value=&quot;12667&quot; color=&quot;007CC2&quot;/&gt;<br>
        &lt;set name=&quot;Usage Threshold Download&quot; value=&quot;17000&quot; color=&quot;9CA279&quot;/&gt;<br>
        &lt;/graph&gt;<br>
<br>
The two values I need are in this case the 1988 and the 12667.<br>
<br>
        &lt;set name=&quot;Actual Usage Download&quot; value=&quot;12667&quot; color=&quot;007CC2&quot;/&gt;<br>
<br>
        &lt;set name=&quot;Actual Usage Upload&quot; value=&quot;1088&quot; color=&quot;007CC2&quot;/&gt;<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&#39;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&#39;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&#39;m doing while they&#39;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>