lang/python/ CsvToHtmlTable


Trivial script to read a Csv file and output it as a simple Html table.

{{c

!/usr/bin/env python3

import sys,csv args = sys.argv[1:] def dofile(csv_file_name): with open(csv_file_name) as csv_file: csv_reader = csv.reader(csv_file,delimiter=',') print("

") for row in csv_reader: print("".format("
{
".join(row))) print("
") for arg in args: dofile(arg) }}}%TIME=1544189860