12

Help needed in csv to html

view full story
linux-howto

http://www.unix.com – Hi, Below is the code i have. But it prints entire csv line in one column. I want to print 10 comma-separated fields in 10 columns. Almost there, maybe a tweak you guys can help with. Code: cat reports/file.csv |awk -v border=1 -v width=10 -v bgcolor=black -v f gcolor=white ' BEGIN { printf("<table border=\"%d\" bordercolor=\"%s\" width=\"%d\" bgcolor=\"%s\"\n>", border,bgcolor,width,fgcolor) printf("<th>Col1</th><th>Col2</th><th>Col3</th><th>Col4</th><th>Tech>&lt (HowTos)