Question

I would like to create tables from some CSV files in UNIX(AIX) and send them as mail(message body). I tried the examples at http://www.snake.net/software/troffcvt/tbl.html but none of them is working for me.

After I run the file as,

 tbl input-file | troff

All I get is something like this,(pasting only a part)

V196 Cbr V163 Cbr V130 Cbr n40 0 H240 V388 h689Cbr V370 Cbr V337 Cbr V304 Cbr V271 Cbr V238 Cbr V205 Cbr V172 Cbr V139 Cbr V106 Cbr V73 Cbr V40 Cbr n40 0 x trailer V2640 x stop

I've tried reading the man pages for troff/tbl but there aren't much examples that I could experiment on. Any directions here would be helpful. Thanks in advance.

Edit: As It is going to send via email, I would like to have an ordinary ASCII table output of the CSV file like user drl post from http ://www.unix.com/shell-programming-scripting/137830-print-screen-table-ascii.html except that I don't have groff here :(.

No correct solution

OTHER TIPS

Two things:

  1. You need to tell troff which output format you are targeting using the '-T' option. Take a look at the groff/troff man page to see what formats are supported.
  2. troff's output is an intermediate form all its own, which you need to pass through a post processor to get to the target output format.

For example if you wanted HTML output you'd need to use something like

tbl input-file|troff -Thtml | grohtml

If you wanted Postscript output you'd need to use something like

tbl input-file|troff -Tps |grops

The name and availability of troff post-processors may vary slightly from platform to platform, so consult your local troff documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top