Re: Script to extract data -

2011-04-15 Thread Cameron Simpson
On 15Apr2011 04:34, Bob Goodwin wrote: | On 14/04/11 19:09, Cameron Simpson wrote: | >On 13Apr2011 16:11, Bob Goodwin wrote: | >| On 13/04/11 15:47, Dave Ihnat wrote: | >|> [ grep | sed approach ... ] | >| | >| [bobg@box9 ~]$ grep "Actual Usage Download" /home/bobg/foo | sed | >|

Re: Script to extract data -

2011-04-15 Thread Sam Sharpe
On 15 April 2011 09:34, Bob Goodwin wrote: > >    I am not familiar with sed and the commands are overwhelming [to >    me]. Man sed hasn't helped ... I am interested. > >    Perhaps you can tell me what's wrong? Wrong tool for the job... sed is not something geared to processing XML. sam@server

Re: Script to extract data -

2011-04-15 Thread Bob Goodwin
On 14/04/11 19:09, Cameron Simpson wrote: > On 13Apr2011 16:11, Bob Goodwin wrote: > | On 13/04/11 15:47, Dave Ihnat wrote: > |> [ grep | sed approach ... ] > | > | [bobg@box9 ~]$ grep "Actual Usage Download" /home/bobg/foo | sed > | -e "s/^.*value=\"//" -e "s/\" .*$//" > |

Re: Script to extract data -

2011-04-14 Thread Cameron Simpson
On 13Apr2011 16:11, Bob Goodwin wrote: | On 13/04/11 15:47, Dave Ihnat wrote: | > [ grep | sed approach ... ] | | [bobg@box9 ~]$ grep "Actual Usage Download" /home/bobg/foo | sed | -e "s/^.*value=\"//" -e "s/\" .*$//" | 12667 | | Aha, that works. It's so much easi

Re: Script to extract data -

2011-04-14 Thread Jake Peavy
On Wed, Apr 13, 2011 at 11:54 PM, Bruno Wolff III wrote: > On Wed, Apr 13, 2011 at 16:24:36 -0400, > Jake Peavy wrote: > > > > 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

Re: Script to extract data -

2011-04-13 Thread Norman Gaywood
On 14 April 2011 06:24, Jake Peavy wrote: > On Wed, Apr 13, 2011 at 3:34 PM, Bob Goodwin > wrote: >> >> I would like to write a script to extract two numbers from the following >> xml file: >> >>        >        xaxisname="Figures Shown Reflect Data Usage in the Last 30 Days" >>        yAxisName=

Re: Script to extract data -

2011-04-13 Thread Bruno Wolff III
On Wed, Apr 13, 2011 at 16:24:36 -0400, Jake Peavy wrote: > > 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. I parse

Re: Script to extract data -

2011-04-13 Thread Jake Peavy
On Wed, Apr 13, 2011 at 3:34 PM, Bob Goodwin wrote: > I would like to write a script to extract two numbers from the following > xml file: > >xaxisname="Figures Shown Reflect Data Usage in the Last 30 Days" >yAxisName="Data Usage" bgColor="E3ECF6" showGridBg="1" >sh

Re: Script to extract data -

2011-04-13 Thread Bob Goodwin
On 13/04/11 15:47, Dave Ihnat wrote: > On Wed, Apr 13, 2011 at 03:34:41PM -0400, Bob Goodwin wrote: >> I would like to write a script to extract two numbers from the following >> xml file: > There are *so* many ways to do this; one brute-force approach: > > Put the following two commands in a file;

Re: Script to extract data -

2011-04-13 Thread Dave Ihnat
On Wed, Apr 13, 2011 at 03:34:41PM -0400, Bob Goodwin wrote: > I would like to write a script to extract two numbers from the following > xml file: There are *so* many ways to do this; one brute-force approach: Put the following two commands in a file; let's call it "foo": grep "Actual Usage

Script to extract data -

2011-04-13 Thread Bob Goodwin
I would like to write a script to extract two numbers from the following xml file: The two values I need are in this case the 1988 and the 12667. I need to create a script I can run daily to check and record our usage i