0% found this document useful (0 votes)
108 views1 page

Team Assessment - CSV Viewer Iteration I

The document describes a team assessment assignment to create a simple CSV file viewer application. The application takes a CSV file as input, reads the file, and displays the data in a paginated table format on the console. It allows navigating between pages of data using keyboard commands. The CSV files contain data records organized into columns separated by semicolons with column names on the first line. The page length can be set either with a default or by passing a value when running the application.

Uploaded by

Ralf Westphal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views1 page

Team Assessment - CSV Viewer Iteration I

The document describes a team assessment assignment to create a simple CSV file viewer application. The application takes a CSV file as input, reads the file, and displays the data in a paginated table format on the console. It allows navigating between pages of data using keyboard commands. The CSV files contain data records organized into columns separated by semicolons with column names on the first line. The page length can be set either with a default or by passing a value when running the application.

Uploaded by

Ralf Westphal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Team assessment assignment

Viewing CSV Files I


Write an application to view CSV files on the console.1 It´s supposed to be a very simple program:
just call it from the command line like this

C:\>csvviewer.exe persons.csv

…and it will display the file´s content in a page wise manner like that:2

Name |Age|City |
-----+---+--------+
Peter|42 |New York|
Paul |57 |London |
Mary |35 |Munich |

N(ext page, P(revious page, F(irst page, L(ast page, eX(it

Pages of data records are displayed as a table with a header line and cell borders like depicted. The
corresponding file looks like follows; when assuming a page length of 3 data records it would be
displayed as three pages:

Name;Age;City
Peter;42;New York
Paul;57;London
Mary;35;Munich
Jaques;66;Paris
Yuri;23;Moscow
Stephanie;47;Stockholm
Nadia;29;Madrid

Each line contains a data record; the first line contains the column names; columns are separated by
";". The data record fields’ content is simple: no line breaks, no field separators, no need to process
values put in "". The encoding of the CSV text files is UTF-8.

The page length should have a reasonable default for your platform´s console windows, but it also
can be set by passing it to the application like this:

C:\>csvviewer.exe persons.csv 40

The page table should have fixed width columns matching the longest value for each column within
a page.

1
A console frontend is used for this exercise because that´s the least common denominator in terms of frontend for all
platforms. Whether you´re doing Ruby or C# or Java you should be able to put a console frontend on top of any
business logic. Sure a GUI would be more stylish, but it also would distract from the main challenges of the exercise.
2
Assume all CSV files to contain only lines of a length fitting a display line; no horizontal scrolling needed. Very likely
all lines are of different length, though.

© www.clean-code-advisors.de

You might also like