Neatly Printing A CSV File

October 4, 2019

Today’s exercise can be either simple or complex, depending on how you define it.

The task is to write a program to neatly print a CSV file. Define “neatly” however you wish. The CSV format has inherently variable-width columns, but you should print the columns neatly aligned. Pages should have headers and footers. Add other features as you wish.

Your task is to write a program to neatly print a CSV file. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.

Advertisement

Pages: 1 2 3

3 Responses to “Neatly Printing A CSV File”

  1. John Cowan said

    To print a CSV file, fire up LibreOffice or Excel and tell it to print. Very simple.

    If you wanted a file instead, tell your program to print or export to a PDF file.

  2. […] the CSV file must be printed as well as loaded into Excel, and I wrote a program to do that in a previous exercise. I recently had a request to produce the output in HTML format, so I wrote that program […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: