Jump to content

CSV to HTML translation: Difference between revisions

→‎{{header|J}}: Icon and Unicon
(→‎{{header|Python}}: Add pretty picture.)
(→‎{{header|J}}: Icon and Unicon)
Line 113:
return EXIT_SUCCESS;
}</lang>
 
=={{header|Icon}} and {{header|Unicon}}==
 
<lang Icon>procedure main(arglist)
local pchar,row,thead
 
pchar := &letters ++ &digits ++ '!?;. ' # printable chars
 
write("<TABLE>")
thead := if !arglist == "-heading" then writes else 1
while row := trim(read()) do {
thead("<THEAD>")
writes("<TR><TD>")
while *row > 0 do
row ?:= ( (=",",writes("</TD><TD>")) | writes( tab(many(pchar)) | ("&#" || ord(move(1))) ), tab(0))
write("</TD></TR>")
thead("</THEAD>")
thead := 1
}
every write("</TBODY>")
end</lang>
 
 
=={{header|J}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.