CSV Table-izer

Function Kata “CSV Table-izer”

Write a function to create a table from CSV data.

The input to the function is a list of strings. Each string is formatted as a CSV record. Here’s an example for a possible input:

In the input a semicolon separates values within a line. More complicated features of CSV (e.g. delimiters within a value) need not be implemented. The input always is correctly formatted; no validation necessary.

The output should be the data formatted as an “ASCII table”. The first record is interpreted as a header line. A separator line should follow the header line. The column width follows the longest value in a column (which includes the header). Here’s an example output for the above input: