Re: Script to extract data -

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14/04/11 19:09, Cameron Simpson wrote:
> On 13Apr2011 16:11, Bob Goodwin<bobgoodwin@xxxxxxxxxxxx>  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 easier when you can find someone
> |         who knows how!
> |
> |         As I said I can muddle through from there, that was the hard part.
>
> Never forget that sed can do what grep does, so (untested, one line):
>
>    sed -n '/Actual Usage Download/s/.*value="\([^"]*".*/\1/p'<  /home/bobg/foo
>
> Cheers,


        This morning's data:

        [bobg@box9 ~]$ cat foo
        <graph caption="Customer: bobgoodwin@xxxxxxxxxxxx"
        xaxisname="Figures Shown Reflect Data Usage in the Last 30 Days"
        yAxisName="Data Usage" bgColor="E3ECF6" showGridBg="1"
        showCanvas="1" numdivlines="4" decimalPrecision="0"
        zeroPlaneColor="CCCCCC" zeroPlaneAlpha="40" numberSuffix="MB">
        <set name="Actual Usage Upload" value="1094" color="007CC2"/>
        <set name="Usage Threshold Upload" value="5000" color="9CA279"/>
        <set name="Actual Usage Download" value="12012" color="007CC2"/>
        <set name="Usage Threshold Download" value="17000" color="9CA279"/>
        </graph>


        [bobg@box9 ~]$ sed -n '/Actual Usage
        Download/s/.*value="\([^"]*".*/\1/p' < /home/bobg/foo
        sed: -e expression #1, char 49: Unmatched ( or \(

        I thought perhaps a permissions problem?

        [bobg@box9 ~]$ su
        Password:
        [root@box9 bobg]# sed -n '/Actual Usage
        Download/s/.*value="\([^"]*".*/\1/p' < /home/bobg/foo
        sed: -e expression #1, char 49: Unmatched ( or \(

    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?

    Thanks much.

    Bob


-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux