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

Re: text to html



On Sat, 2010-07-03 at 11:07 +0200, Jozsi Avadkan wrote:
> input:
> http://pastebin.com/raw.php?i=MqPXZwc3
> 
> output:
> http://pastebin.com/raw.php?i=8QCkp4yv

Just for fun:
perl -ne 'm{^(([^/]*).*/([^/]*).html)}; exit unless defined($2); if ($d ne $2){defined($d) && print "<br>\n"; $d = $2; print "<br><font size=4>$d</font><br>\n";} print qq{<a href="$1">$3</a> | \n};' < input > output

Some tweaks required depending on whether you do or don't want trailing
|'s and/or trailing spaces, and I agree there are 2 entries in your
sample output that don't match :-)

Richard



Reply to: