Re: Parsing output into a usable format.

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

 



On Fri, Mar 09, 2007 at 11:40:08AM +0000, Paul Ward wrote:
> Hi All,
> 
> Can someone please lend me a hand to parse the following text into a
> usable format.
> 
> I am grepping a web page for a numeric figure that appears only on one
> line using the following
>          #lynx  -source http://172.19.100.127/eng/main.htm|grep  sVal\\[7\\]
> This produces the following output
>          #sVal[7] = "2016";
> I want to be able to extract only the numeric figure so it can be used
> in a expr sum.


#lynx  -source http://172.19.100.127/eng/main.htm | \
		perl -nle 'print $1 if /sVal\[7\]\s*=\s*"(\d+)"/'

-- 
A major Starfleet emergency breaks out near the Enterprise, but
fortunately some other ships in the area are able to deal with it to
everyone's satisfaction.
    -- Things That Never Happen in "Star Trek" #13


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux