perl or bash question ["convert strings in a txt to html links"]
- To: Debian User Mailing list <firstname.lastname@example.org>
- Subject: perl or bash question ["convert strings in a txt to html links"]
- From: Vadkan Jozsef <email@example.com>
- Date: Sat, 27 Feb 2010 18:12:02 +0100
- Message-id: <1267290722.2365.12.camel@ubuntu>
How can I do that in bash or perl, that I have a txt file, e.g.:
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,
This is the second line, that doesn't contains links..
This is the XYZ line, that contains a link: http://www.somewhere.net
...ok.. so how could I make a regexp for this?
The solution would be:
sed 'SOMEMAGIC' file.txt > file.html
perl 'SOMEBIGMAGIC' file.txt > file.html