View Single Post
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is online now
Ok, lets break this down....

gets that page.

the sed -n '21p' parses out the following...

Code:
mikeMbp:~ mike$ cat wundweather.tst |sed -n '21p'
  <span class="nowrap"><b>14</b>°C</span>
mikeMbp:~ mike$
sed -e 's/<span class="nowrap"><b>//g' and sed -e 's/<\/b.*//g' are line substitution strings so the first gets us
Code:
mikeMbp:~ mike$ cat wundweather.tst |sed -n '21p'|sed -e 's/<span class="nowrap"><b>//g'
  14</b>°C</span>
and the second gets us
Code:
mikeMbp:~ mike$ cat wundweather.tst |sed -n '21p'|sed -e 's/<span class="nowrap"><b>//g'| sed -e 's/<\/b.*//g' 
  14
Now, if your OTHER page is not identically laid out.. you'll have to change your sed statements to match. I have to go pick my kids up from school, I'll check when I get back and play with that one if need be.

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks