text to html

Rodolfo Alcazar Portillo nospaze at gmail.com
Sat Jul 3 18:43:37 UTC 2010


On Sat, 2010-07-03 at 15:20 +0100, Sam Sharpe wrote:
> On 3 July 2010 14:16, Rodolfo Alcazar Portillo <nospaze at gmail.com> wrote:
> > 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
> >>
> >> it will be a long day.. :D
> >
> > Not likely. Obviously, you must replace lynx with cat <file>.
> >
> > lynx -dump http://pastebin.com/raw.php?i=MqPXZwc3|sed -r 's/([^\/]*)\/(.*)\.html/<br><font size=4>\1<\/font><br>\n<a href="\1\/\2.html">\2<\/a> |/g'
> >
> 
> I'm afraid that's a fail - it doesn't match the desired output.

Oh, oh, oh, oh. Didn't check the grouping. There you go (one-liner, just
using one FOR):

FILE=$(lynx -dump http://pastebin.com/raw.php?i=MqPXZwc3); SETS=$(echo "$INPUT"|cut -f1 -d/|uniq); for S in $SETS; do echo "<br><font size=4>$S</font><br>"; echo "$FILE"|grep "^$S"|sed -r "s/(.*)\/(.*).html/<a href=\"\1\/\2.html\">\2<\/a>|/g"; echo "<br>"; done

Bye!
----------------------------------------------
Rodolfo Alcazar Portillo - nospaze at gmail.com
otbits.blogspot.com / counter.li.org: #367962
----------------------------------------------
Programming is like sex: One mistake and you're providing support for
a lifetime. -- ?




More information about the users mailing list