Hello,
Can you help me please ?
First with wget i download a web page,
After with awk i search a first pattern and in need extract next other pattern, example:
web page contain :
blablabla,hello world!!!,my cat is funny, password 1234, blablabla
I want extract the fisrt pattern contain "password" after found "hello world!!!" pattern
Thanks all.
Regard.
[/quote]
awk question
One way
Another way
Code: Select all
# echo 'blablabla,hello world!!!,my cat is funny, password 1234, blablabla' |awk '/hello world!!!/{if(match($0,/password [^,]+/)) print substr($0,RSTART,RLENGTH)}'
password 1234
Code: Select all
# echo 'blablabla,hello world!!!,my cat is funny, password 1234, blablabla' |gawk '/hello world!!!/{if(match($0,/password ([^,]+)/,a)) print a[1]}'
1234
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]
- fabrice_035
- Posts: 765
- Joined: Mon 28 Apr 2014, 17:54
- Location: Bretagne / France