Re: <link> not clickable from text document

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Sun, 31 Jul 2005 10:40:05 -0500
Jeff Vian wrote:

> > Alexander Dalloz wrote:
> > ...
> > > sed 's|^http://\(.*\)/|<a href="\1">\1</a>|g; s|href="|
> > > href="http://|g' linklist.txt > clicklist.txt
> > > 
>      ^^^^^^^^^^    ^^^^^^^^^^^^
> 
> Note that Alexander gave you (examples of) an input file and an output
> file that are different.  You will need to use 2 different filenames
> for sed to work. The input file must exist, the output file will be
> created.
> 
> In your command below, the input file does not exist so it cannot
> perform the task.  This is seen in the output of your 'll' command.
>

I think you do understand, now.

> > 
> > Thanks, Alexander.  I did:
> > 
> > [thufir@arrakis click]$
> > [thufir@arrakis click]$
> > [thufir@arrakis click]$
> > [thufir@arrakis click]$ date
> > Sun Jul 31 15:41:46 IST 2005
> > [thufir@arrakis click]$ pwd
> > /home/thufir/click
> > [thufir@arrakis click]$ ll
> > total 24
> > -rw-rw-r--  1 thufir thufir 5366 Jul 31 08:37 clicklist.txt
> > -rw-rw-r--  1 thufir thufir 5366 Jul 31 15:38 clicklist.txt.backup
> > [thufir@arrakis click]$ sed 's|^http://\(.*\)/|<a href="\1">\1</a>|
> > g; s|href="|href="http://|g'
> > 
> > linklist.txt > clicklist.txt
> >  
> > 
> > about how long should this take?  I gave the command 60 seconds and
> > hit ctrl-c to cancel it.  examining clicklist.txt shows no change.
> > 
> > Aha, I might've provided faulty data.  The links aren't all of the
> > form 
> > 
> > http://www.foo.com/
> > 
> > but more like
> > 
> > http://ipac3.vpl.ca/ipac20/ipac.jsp?uri=...
> > 
> > is that the problem?
> >  
> > 
> > Thanks,
> > 
> > Thufir
> > 

Try this:

$ sed 's|^http://\(.*/\)\(.*\)|<a href="\1\2">\1</a>|g; s|href="|
href="http://|g' /input/file/with/links > /output/file/with/clicklinks


It's minimal changed from the first example, which didn't things well
when i tried it out with your uri.


Thomas


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux