# TODO: Implement quoting properly function quote_html(s) { return s; } function quote_html_attribute(s) { return gensub("\"", """, "g", s) } BEGIN { FS = ":" num_rows = 0 num_cols = 0 read_header = 1 # h/t https://wabain.github.io/2019/10/13/css-rotated-table-header.html print "
" for (i=0; i < num_cols; i++) { printf " | %s | ", quote_html_attribute(col_headers[i]), quote_html(col_headers[i])
}
print "
---|---|
%s | ", quote_html_attribute(row_header), quote_html(row_header) for (j = 0;j < num_cols; j++) { printf "" rows[i][j] " | " } print "