zahniser.net :: software

— etc —

 

— HyperList —

Hierarchical to-do lists

— hsiloP —

Calculator program

— Hexie —

Hex editor

— Mirth —

Read daily comics

— Strange —

Chaotic attractors

 

 

 

contact email:

michael at zahniser dot net

etc :: tableprint

Download: tableprint.cpp (should compile on any platform).

I wrote this program mainly to format the output of weatherscrape for display on my desktop using GeekTool. But it can be used any time you want to view a tab-delimited table with the columns properly aligned, without loading it into a spreadsheet program. For example, in my terminal the output of "$weatherscrape" looks like this:

20080524        Partly Cloudy   67      48      20
20080525        Sunny   71      53      20
20080526        Mostly Cloudy   75      59      20
20080527        Scattered T-Storms      75      50      40
20080528        Showers 67      49      40
20080529        Sunny   69      50      20
20080530        Partly Cloudy   71      51      0
20080531        Cloudy  71      51      20
20080601        Showers 68      50      40
20080602        Sunny   70      51      20
  

Rather ugly, right? It's hard to tell what is in what column. The output of "$weatherscrape | tableprint" is much more readable:

20080524  Partly Cloudy       67  48  20  
20080525  Sunny               71  53  20  
20080526  Mostly Cloudy       75  59  20  
20080527  Scattered T-Storms  75  50  40  
20080528  Showers             67  49  40  
20080529  Sunny               69  50  20  
20080530  Partly Cloudy       71  51  0   
20080531  Cloudy              71  51  20  
20080601  Showers             68  50  40  
20080602  Sunny               70  51  20