views:

33

answers:

2

Where can I find an implementation for a text/ascii table/grid generator? e.g. Given a CSV file such as this:

Header1,Header2,Header3  
Pizza,Artichoke dip,Bob's Special of the Day  
BLT,Ham on rye with the works,

It would generate a nice looking text table such as this:

Header1     Header2     Header3  
----------------------------------------
Pizza       Artichoke   Bob's Special of
                        the Day
BLT         Ham on rye 
            with the 
            works

Nice features to have would be the ability to specify the number of characters per column and implemented for .NET. I'm not too particular about the input format or the output; I'm just looking for something to get the job done.

I spent a bit of time searching for this online, but you know what happens when you start searching for "ascii table"... Hoping to find something before I roll my own implementation. Thanks in advanced.

A: 

The C# string formatter (System.String.Format) has fixed width formats available. Multi-line stuff isn't supported, as it's not necessarily in the same order as the text inputted.

McKay