|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need to grab URL and place between <A></A> Tags
my output looks like: Code:
<A HREF="http://support.apple.com/kb/HT1629"> </A> <A HREF="http://support.apple.com/kb/HT1200"> </A> <A HREF="http://old.nabble.com/AFP-eating-up-CPU-td19976358.html"> </A> <A HREF="http://jochsner.dyndns.org/scripts/NHR.html"> </A> <A HREF="http://jochsner.dyndns.org/scripts/NHR.html"> </A> <A HREF="http://go2xserve.com/"> </A> <A HREF="http://go2xserve.com/"> </A> <A HREF="http://www.afp548.com/article.php?story=MCXRedirector"> </A> <A HREF="http://www.afp548.com/article.php?story=MCXRedirector"> </A> <A HREF="http://rentzsch.com/macosx/fs_usageIntro"> </A> <A HREF="http://support.apple.com/kb/HT2370"> </A> I need to grab each URL from http until the ending double quotes and place it between the > and </A> Example: <A HREF="http://support.apple.com/kb/HT2370"> </A> should become <A HREF="http://support.apple.com/kb/HT2370">Apple Remote Desktop: Configuring remotely via command line (kickstart) </A> Last edited by scottn; 12-18-2009 at 07:31 PM.. Reason: Added code tags |
| Sponsored Links | ||
|
|
|
#2
|
|||
|
|||
|
So, you mean you want to insert the text in between there?
|
|
#3
|
|||
|
|||
|
woops, I meant I want the URL from the same line to be inserted there.. In my example it translated the link
|
|
#4
|
|||
|
|||
|
Code:
gawk '/<A HREF=/ {
o=$0
gsub(/<A HREF=\042|\042>.*/,"",o)
link=o
gsub(/> <\/A>/,">"link"</A>")
print
}' file |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is the best way to copy data from place to another place? | unitipon | Solaris | 9 | 11-16-2009 10:34 AM |
| SSH Grab n' Go | unimachead | OS X (Apple) | 0 | 10-15-2009 05:57 PM |
| Grab a smaller and larger value | Raynon | Shell Programming and Scripting | 3 | 10-11-2007 06:23 AM |
| grab the line using awk | cdfd123 | Shell Programming and Scripting | 1 | 10-10-2007 08:21 AM |
| How to grab data between 2 strings ? | Raynon | Shell Programming and Scripting | 16 | 10-06-2006 10:37 AM |