#!/usr/bin/nawk -f # Some kludgey awk to take input of the form # Blah blah (a date format) # Some title # http://link # http://link # # # Write some html close enough to the format used # in http://blogs.sun.com/timf/entry/opensolaris_in_review_february_2008 BEGIN { date=0; http=0; } /^http/ { print ""$0"
"; http=1; } # Yeah, we'll have a Y2100 problem, I'm not worried. /20[0-9][0-9][ ]*$/ { print "
  • "$0"
    " date=1; printedli=0 } { # hack if (http == 1) { http=0; } else if (date == 1) { date = 0; } else if ( $0 == "") { if (printedli != 1) { print "
  • \n" printedli=1 } else { print "\n" } } else { print ""$0"
    " http=0 date=0 } } END { if (printedli == 0){ print "\n"; } }