![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help... to extract the substring | dashok.83 | Shell Programming and Scripting | 4 | 08-05-2008 04:23 PM |
| Sed extract substring on (OS X) | mlommel | Shell Programming and Scripting | 3 | 06-12-2008 07:38 PM |
| Extract a substring using regular expression | apraja | Shell Programming and Scripting | 2 | 03-04-2008 05:47 PM |
| how to extract a substring froma file | morena | UNIX for Dummies Questions & Answers | 1 | 01-23-2008 07:22 PM |
| command/script to extract a substring from a string | girisha | Shell Programming and Scripting | 5 | 09-21-2006 01:30 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Extract a substring.
I have a shell script that uses wget to grab a bunch of html from a url.
URL_DATA=`wget -qO - "$URL1"` I now have a string $URL_DATA that I need to pull a substring out of..say I had the following in my string <p><a href="/scooby/929011567.html">Dog pictures check them out! -</a><font size="-1"> (Silly)</font></p> <p><a href="/shaggey/928861647.html">Vacation -</a><font size="-1"> (boating)</font></p> <p><a href="/gopher/928782568.html">Garden -</a><font size="-1"> (winter)</font></p> I want to extract the URL, Title and Description throughout the string...like the following /scooby/929011567.html Dog pictures check them out! (silly) /shaggey/928861647.html Vacation (boating) /gopher/928782568.html Garden (winter) and keep going with that pattern as many times as it's in the string. How would I do this? |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|