Results 1 to 3 of 3
How can I extract the
/staticfiles/NGS/Shared/StaticFiles/Photography/Images/POD/u/underwater-doubilet-697088-ga.jpg
part from the line:
<td class="body"><a href="/photography/enlarge/underwater-doubilet_pod_image.html"><img alt="Photo: Eel blenny peeking out of coral" src="/staticfiles/NGS/Shared/StaticFiles/Photography/Images/POD/u/underwater-doubilet-697088-ga.jpg"></a></td>
?
Note: The pattern string is constant upto
/staticfiles/NGS/Shared/StaticFiles/Photography/Images/POD/
...
- 11-12-2008 #1
How to extract pattern substring from a line
How can I extract the
part from the line:/staticfiles/NGS/Shared/StaticFiles/Photography/Images/POD/u/underwater-doubilet-697088-ga.jpg
?<td class="body"><a href="/photography/enlarge/underwater-doubilet_pod_image.html"><img alt="Photo: Eel blenny peeking out of coral" src="/staticfiles/NGS/Shared/StaticFiles/Photography/Images/POD/u/underwater-doubilet-697088-ga.jpg"></a></td>
Note: The pattern string is constant upto
The rest of it changes./staticfiles/NGS/Shared/StaticFiles/Photography/Images/POD/
Thank you.Last edited by imranka; 11-12-2008 at 07:04 AM. Reason: typo
Imran
Linux User #467555 | Debian Squeeze | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | 1 GB RAM | 320 GB SATA
- 11-12-2008 #2
With cut I managed that:
echo $line|cut -d= -f5|cut -d\" -f2Imran
Linux User #467555 | Debian Squeeze | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | 1 GB RAM | 320 GB SATA
- 11-15-2008 #3Linux User
- Join Date
- May 2008
- Location
- NYC, moved from KS & MO
- Posts
- 251
echo $line | awk -F 'src="|"></a>' '{print $2}'


Reply With Quote
