.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SHOWTABLE 1p" .TH SHOWTABLE 1p "2022-10-13" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" showtable \- Show data in nicely formatted columns .SH "USAGE" .IX Header "USAGE" \&\fBshowtable\fR [\-\fIoptions\fR] [\fIfile\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBShowtable\fR reads an input data stream and displays it in a nicely formatted listing, with exact formatting depending upon the options. The input stream, \fIfile\fR or \f(CW\*(C`STDIN\*(C'\fR by default should consist of data separated by tabs or the defined \fIseparator\fR character (see \fB\-d\fR). .PP The actual output formatting is peformed by the \fBShowTable\fR module. .SH "OPTIONS" .IX Header "OPTIONS" There are two general sets of options: those which help determine the format of the input, and those which determine the format of the output. .SS "\fBOptions affecting input\fP" .IX Subsection "Options affecting input" .IP "\fB\-break=\fR\fIstr\fR" 10 .IX Item "-break=str" Set the inter-column break string to "\fIstr\fR\*(L". The default is a tab (\*(R"\f(CW\*(C`\et\*(C'\fR"). If \fB\-strip\fR is also given, blanks surrounding the break string will also be ignored. .IP "\fB\-d\fR\fIstr\fR" 10 .IX Item "-dstr" This is the same as \f(CW\*(C`\-break=\*(C'\fR\fIstr\fR. .IP "\fB\-nod(ashes)\fR" 10 .IX Item "-nod(ashes)" Do not ignore lines of separators, such as dashes, equal signs, or underlines. If \fB\-nodashes\fR is given, and these lines do occur in the stream, they will be treated as normal data. .IP "\fB\-ti(tles)[=\fR\fI\s-1NN\s0\fR\fB]\fR" 10 .IX Item "-ti(tles)[=NN]" Treat the first \fI\s-1NN\s0\fR rows of data as column titles; multiple words in the column titles may wrap vertically. If \fI\s-1NN\s0\fR is omitted, it defaults to 1. No \fB\-titles\fR option is the same as \fB\-titles=0\fR. .IP "\fB\-in(put)=\fR\fItype\fR" 10 .IX Item "-in(put)=type" Set the input type as \fItype\fR, which can be one of: \fIbox\fR, \fIlist\fR, \fItable\fR, or \fIsimple\fR. A \fIsimple\fR\-type table is the same as a \fItable\fR\-type, but no wrapping characters are recognized. .IP "\fB\-s(trip)\fR" 10 .IX Item "-s(trip)" Strip blanks from around the column values. .IP "\fB\-nos(trip)\fR" 10 .IX Item "-nos(trip)" Do not strip blanks from the input. Useful if there is formatted or aligned data within a boxed table. .SS "\fBOptions affecting output\fP" .IX Subsection "Options affecting output" .IP "\fB\-t(able)\fR" 10 .IX Item "-t(able)" Use a \fItable\fR format for output, with wrapping of column values longer than the given or determined column widths. See Data::ShowTable for more details. .IP "\fB\-si(mple)\fR" 10 .IX Item "-si(mple)" Use a simple table format, without any wrapping of column values. See Data::ShowTable for more details. .IP "\fB\-l(ist)\fR" 10 .IX Item "-l(ist)" Use a list style format. See Data::ShowTable for more details. .IP "\fB\-b(ox)\fR" 10 .IX Item "-b(ox)" Use a \*(L"boxed\*(R" style table. See Data::ShowTable for more details. .IP "\fB\-ht(ml)\fR" 10 .IX Item "-ht(ml)" Use HTML-formating. See Data::ShowTable for more details. .IP "\fB\-ti(tles)=\fR\fIname1\fR\fB,\fR\fIname2\fR\fB,...,\fR\fInameN\fR" 10 .IX Item "-ti(tles)=name1,name2,...,nameN" Define the column names explicitly. This is useful for naming columns of data from \f(CW\*(C`STDIN\*(C'\fR, when \fBshowtable\fR is being used as a filter. The first column name, \fIname1\fR, cannot begin with a digit. This option allows any column titles obtained from the input to be overridden. .IP "\fB\-noh(eaders)\fR" 10 .IX Item "-noh(eaders)" Do not output any headers on the tables; \fB\-titles=0\fR implies this option. .IP "\fB\-f\fR\fIn1\fR[,\fIn2\fR, ..., \fInN\fR]" 10 .IX Item "-fn1[,n2, ..., nN]" Select fields numbered \fIn1\fR, \fIn2\fR, etc., to display. Each \fInN\fR is a field index, or a range of indexes in the form: \f(CW\*(C`N\*(C'\fR\-\f(CW\*(C`M\*(C'\fR The default is to show all the fields in each row. Fields are numbered from 1. An example: to show the first, and three through five fields of the \&\f(CW\*(C`/etc/passwd\*(C'\fR file: .Sp .Vb 1 \& showtable \-d: \-f1,2\-5 /etc/passwd .Ve .IP "\fB\-fields\fR=\fIfname1\fR[,\fIfname2\fR, ..., \fIfnameN\fR]" 10 .IX Item "-fields=fname1[,fname2, ..., fnameN]" Select the named fields to display. The field names must be available, either through the data stream, or by using the \fB\-titles\fR option. The field names given must match the existing field names \fIexactly\fR. .Sp Using the file \f(CW\*(C`/etc/passwd\*(C'\fR for another example: to show the same first two fields, by name: .Sp .Vb 1 \& showtable \-d: \-titles=Login,UID \-fields=Login,UID /etc/passwd .Ve .IP "\fB\-w(idth)\fR=\fInum\fR" 10 .IX Item "-w(idth)=num" Set the maximum table width. This value is applied to the variable Data::Showtable::Max_Table_Width. When the total width of all columns to be displayed exceeds this value, all column widths are scaled uniformly. .Sp If \fB\-width\fR is not given, then for all output but \fB\-html\fR, the default value is either "\f(CW\*(C`COLUMNS\*(C'\fR", if defined, or 80, if not. Whith \fB\-html\fR mode, there is no default value for \fB\-width\fR; in other words, there is no limit to the width. .IP "\fB\-cw(idths)\fR=\fIw1\fR[,\fIw2\fR,...,\fIwN\fR]" 10 .IX Item "-cw(idths)=w1[,w2,...,wN]" Set individual column widths to the specified values. Empty column widths imply no maximum width. If the \fB\-width\fR option is also given, then the \fB\-cwidth\fR column widths can also be given as fractions or percentages. .Sp Example: To set the maximum width of the third column to 20 characters: .Sp .Vb 1 \& \-cw=,,20 .Ve .SS "\fBHTML-only options\fP (the usage of which implies \fB\-html\fP)" .IX Subsection "HTML-only options (the usage of which implies -html)" .IP "\fB\-noe(scape)\fR" 10 .IX Item "-noe(scape)" Do not perform \s-1HTML\s0 escape sequences on the data; this allows embedded \&\s-1HTML\s0 text in the data to be displayed properly with the \fB\-html\fR option. .IP "\fB\-attributes\fR='\fIattr1\fR \fIattr2\fR ...'" 10 .IX Item "-attributes='attr1 attr2 ...'" Declare the table attributes, which are inserted into the \f(CW\*(C`TABLE\*(C'\fR token. For example, the option: .Sp .Vb 1 \& \-attributes=\*(AqBORDER=0 CELLSPACING=2 CELLPADDING=4\*(Aq .Ve .Sp would cause the following \s-1HTML:\s0 .Sp .Vb 1 \&