Re: Script to extract data -

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

 



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; let's call it "foo":
>
>    grep "Actual Usage Download" foo | sed -e "s/^.*value=\"//" -e "s/\" .*$//"
>    grep "Actual Usage Upload" foo | sed -e "s/^.*value=\"//" -e "s/\" .*$//"
>
> Make the file executable:
>
>    chmod a+rx foo
>
> Then, if your XML file is named bar.xml:
>
>    foo<bar.xml
>
> (If the file isn't in your path, "./foo", etc.)
>
> Cheers,
> --
> 	Dave Ihnat
> 	dihnat@xxxxxxxxxx

        [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!

        I said I can muddle through from there, that was the hard part.

        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