perl or bash question ["convert strings in a txt to html links"]

CLIFFORD ILKAY clifford_ilkay at dinamis.com
Sat Feb 27 17:16:37 UTC 2010


On 02/27/2010 12:12 PM, Vadkan Jozsef wrote:
> How can I do that in bash or perl, that I have a txt file, e.g.:
>
> $cat file.txt Hi, this is the content of the txt file, that contains
> links like this: http://www.somewhere.it/, and it could contain:
> http://somewhere.com, etc.. This is the second line, that doesn't
> contains links.. .. This is the XYZ line, that contains a link:
> http://www.somewhere.net $

You could take a look at the source for 
<http://docs.djangoproject.com/en/1.1/ref/templates/builtins/#urlize> 
and see how it's done in Python and extrapolate from there.
-- 
Regards,

Clifford Ilkay
Dinamis
1419-3266 Yonge St.
Toronto, ON
Canada  M4N 3P6

<http://dinamis.com>
+1 416-410-3326




More information about the ubuntu-users mailing list