Parsing output into a usable format.

Paul Ward pnward at googlemail.com
Fri Mar 9 11:40:08 UTC 2007


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.
the figure can be anywhere from 0 to several million.
I am using the following but need the last 2 characters to allways be removed.
         # lynx  -source http://172.19.100.127/eng/main.htm|grep
sVal\\[7\\] | cut -c 12-20
         # 2016";
What is the best way? I tried using a delimeter of " but can not seem
to get it to work #
         #lynx  -source http://172.19.100.127/eng/main.htm|grep
sVal\\[7\\]|cut -d, -f"

Thanks

Paul




More information about the fedora-list mailing list