| tprint | tables | tprint |
tprint -- Convert an STSDAS table to a readable ASCII file.
tprint table
This task is similar to the tdump task in that it takes an STSDAS table and produces a file in ASCII format; however, this task offers more control over the appearance of the final product and better prepares it for printing. Formatting options are available to control the width and length of a page, and to produce the output in HTML, TeX or LaTeX format.
By default, all rows and columns in the input tables will be printed, but the rows and columns parameters can be used to limit the range of rows and columns, respectively, that will be used. When using the TeX or LaTeX options, the number of output columns is limited to 52. For the HTML option, all the rows and columns that are to be printed will be written to one HTML table, rather than broken into pages. There is no limit to the number of columns in ASCII format; however, if the aggregate column width exceeds the page width the output will be produced in sections with columns kept together on a page--lines will not wrap. If different columns for each row are printed on separate pages, the row number will appear on each page, if showrow = yes.
The output will be printed to the standard output.
This parameter is not used if option = "html".
This parameter is not used if option = "html".
If the sp_col parameter is not null or if the lgroup parameter is greater than zero, the blank lines between groups are included in the count of lines per page. Thus lgroup = 50 and plength = 51 would be consistent and would give the same result as lgroup = 0, plength = 50.
If more than one page is needed in order to print all the columns specified, then the row numbers will be printed on each page. If showrow = no then row numbers are not printed.
This parameter only has an effect if a row selector expression was included with the table name, in which case the table appears to have fewer rows than are actually present in the underlying table (the complete table, including all rows). When orig_row is yes, the default, the row numbers printed are those in the underlying table; when orig_row is no, the selected rows are numbered sequentially starting with one, as if those were the only rows in the table.
The table name, date of last modification, and column names are printed only if showhdr = yes. If the option parameter (see below) is set to either "latex" or "tex", then showhdr will affect the printing of the default macro definitions for column separators and the end-of-line string as well as the begin-table string (i.e., "\begin{tabular}..." or "\halign...").
A null or blank string means print all columns. This parameter is a column template--that is, either a list of column names or a template that can contain wildcard characters. The column names should be separated by commas or white space. The list of column names can be placed in a file and the name of the file preceded by "@" passed to columns. If the first character in the column template is the negation character (either "~" or "!"), all columns NOT named will be printed.
If you want to use a list file for this parameter, the tlcol task can be used to make the list (be sure to set the nlist parameter to 1). Using the tlcol task can eliminate potential problems caused by incorrect spelling. The list produced by tlcol can also be edited to rearrange column names (to change the order for printing) or to delete unwanted columns.
This parameter takes a character string defining either specific rows to be printed, a range of rows, or upper or lower limits on row numbers. The default value "-" means print all rows. The first ten rows could be specified as rows="1-10" or just rows="-10". To print the first ten rows and all rows from 900 through the last (inclusive), use rows="-10,900-". Setting rows="1,3,7,23" will print only those four rows. It is not an error to specify rows larger than the largest row number; excess row numbers will simply be ignored. (For more information type "help ranges".)
If option = "html", the output will be formatted with HTML tags, and the output should be redirected to a file having the extension ".html".
If option = "latex", the output will be formatted for use as input to LaTeX, and if option = "tex", the output will be formatted for use as input to TeX. In these two cases the output should be redirected to a file having the extension ".tex". Each value in each row will be preceded by a column-separator of the form "\cola" through "\colz", "\colA" through "\colZ". (Yes, there is a limit of 52 columns to be printed on one page.) If the row number is printed (i.e., by using the showrow parameter) it will be preceded by the string "\colzero"; the string "\cola" always precedes the first column from the table. The default definitions assign "\null" to the first of these (either "\colzero" or "\cola") and assign "&" to all the rest. Each row may span several physical rows and is terminated by "\eol", which has the default definition of "\\" or "\cr" as appropriate. (See also the description of the parameter showhdr).
The equality test is made on formatted values in the column so that the user has more control over spacing when the data type of sp_col is either real or double. The print format may be changed using either the tedit or tchcol tasks. Both sp_col and lgroup may be used together, which may be useful if the sp_col column does not change very often.
If any column that is being printed contains array elements rather than just scalar values, grouping by lgroup will be applied to array elements rather than to row numbers. If option = "plain" and the window width (or pwidth if output is redirected) is not large enough for all the columns, the spacing can be by row number on some pages and element number on other pages, depending on which columns fit on those pages (i.e. whether the columns contain arrays).
1. Print all tables in the default directory.
tt> tprint *.tab
2. Print junk.tab, but rearrange the columns.
tt> tlcol junk nlist=1 >colnames.lis
tt> edit colnames.lis
(Rearrange the column names and perhaps delete some of them.)
tt> tprint junk columns=@colnames.lis
3. After using the tinfo task to find that big.tab has 100000 rows, print the first five and last five rows.
tt> tprint big rows="1-5,99996-"
This task was written by Phil Hodge.
tdump, ranges