trofftbl

How to use `tbl` command for more than 72 lines?


I used tbl command to format the data in a tabular format and it worked fine for a file which contain 71 lines and when I added another line in the file it break with below error -

error: page 2: table will not fit on one page; use .TS H/.TH with a supporting macro package

then I looked at the man page and found the same info. and tried all possible combination of use .TS and .TE in input file. Please share your solution if you have came across this kind of problem.

snapshot of command that I am using - cat file.txt .TS tab(:) ce|ce|ce|ce|ce|ce row1-col1:col2:col3:col4:col5:col6 row2-cola:colb:colc:cold:cole:colf ....... ....... row72-cola:colb:colc:cold:cole:colf .TE

Passing this file to tbl command like below -

tbl file.txt|groff -T ascii

Is there a way to use .TS, .TH and '.TE` to process more than 71 lines?


Solution

  • Here is the solution to print the output in tabular format using tbl for multi page -

    .TS H tab(:) ce|ce|ce|ce|ce|ce .TH row1-col1:col2:col3:col4:col5:col6 row2-cola:colb:colc:cold:cole:colf ....... ....... row72-cola:colb:colc:cold:cole:colf .TE

    And need to use this file like below -

    tbl file.txt|groff -ms -T ascii