{
    "mode": "man",
    "parameter": "showtable",
    "section": "1p",
    "url": "https://www.chedong.com/phpMan.php/man/showtable/1p/json",
    "generated": "2026-06-15T22:20:41Z",
    "sections": {
        "NAME": {
            "content": "showtable - Show data in nicely formatted columns\n",
            "subsections": []
        },
        "USAGE": {
            "content": "showtable [-options] [file]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Showtable reads an input data stream and displays it in a nicely formatted listing, with\nexact formatting depending upon the options.  The input stream, file or \"STDIN\" by default\nshould consist of data separated by tabs or the defined separator character (see -d).\n\nThe actual output formatting is peformed by the ShowTable module.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "There are two general sets of options: those which help determine the format of the input,\nand those which determine the format of the output.\n",
            "subsections": [
                {
                    "name": "Options affecting input",
                    "content": ""
                },
                {
                    "name": "-break=",
                    "content": "Set the inter-column break string to \"str\".  The default is a tab (\"\"\\t\"\").  If\n-strip is also given, blanks surrounding the break string will also be ignored.\n"
                },
                {
                    "name": "-d",
                    "content": "",
                    "flag": "-d"
                },
                {
                    "name": "-nod(ashes)",
                    "content": "Do not ignore lines of separators, such as dashes, equal signs, or underlines.  If\n-nodashes is given, and these lines do occur in the stream, they will be treated as\nnormal data.\n"
                },
                {
                    "name": "-ti(tles)[=",
                    "content": "Treat the first NN rows of data as column titles; multiple words in the column\ntitles may wrap vertically. If NN is omitted, it defaults to 1.  No -titles option\nis the same as -titles=0.\n"
                },
                {
                    "name": "-in(put)=",
                    "content": "Set the input type as type, which can be one of: box, list, table, or simple.  A\nsimple-type table is the same as a table-type, but no wrapping characters are\nrecognized.\n"
                },
                {
                    "name": "-s(trip)",
                    "content": ""
                },
                {
                    "name": "-nos(trip)",
                    "content": "Do not strip blanks from the input.  Useful if there is formatted or aligned data\nwithin a boxed table.\n"
                },
                {
                    "name": "Options affecting output",
                    "content": ""
                },
                {
                    "name": "-t(able)",
                    "content": "or determined column widths.  See Data::ShowTable for more details.\n"
                },
                {
                    "name": "-si(mple)",
                    "content": "Data::ShowTable for more details.\n"
                },
                {
                    "name": "-l(ist)",
                    "content": ""
                },
                {
                    "name": "-b(ox)",
                    "content": ""
                },
                {
                    "name": "-ht(ml)",
                    "content": ""
                },
                {
                    "name": "-ti(tles)=",
                    "content": "Define the column names explicitly.  This is useful for naming columns of data from\n\"STDIN\", when showtable is being used as a filter.  The first column name, name1,\ncannot begin with a digit.  This option allows any column titles obtained from the\ninput to be overridden.\n"
                },
                {
                    "name": "-noh(eaders)",
                    "content": "Do not output any headers on the tables; -titles=0 implies this option.\n"
                },
                {
                    "name": "-f",
                    "content": "Select fields numbered n1, n2, etc., to display.  Each nN is a field index, or a\nrange of indexes in the form: \"N\"-\"M\" The default is to show all the fields in each\nrow.  Fields are numbered from 1.  An example:  to show the first, and three\nthrough five fields of the \"/etc/passwd\" file:\n\nshowtable -d: -f1,2-5 /etc/passwd\n",
                    "flag": "-f"
                },
                {
                    "name": "-fields",
                    "content": "Select the named fields to display.  The field names must be available, either\nthrough the data stream, or by using the -titles option.   The field names given\nmust match the existing field names exactly.\n\nUsing the file \"/etc/passwd\" for another example: to show the same first two\nfields, by name:\n\nshowtable -d: -titles=Login,UID -fields=Login,UID /etc/passwd\n"
                },
                {
                    "name": "-w(idth)",
                    "content": "Set the maximum table width.  This value is applied to the variable\nData::Showtable::MaxTableWidth.  When the total width of all columns to be\ndisplayed exceeds this value, all column widths are scaled uniformly.\n\nIf -width is not given, then for all output but -html, the default value is either\n\"\"COLUMNS\"\", if defined, or 80, if not.  Whith -html mode, there is no default\nvalue for -width; in other words, there is no limit to the width.\n"
                },
                {
                    "name": "-cw(idths)",
                    "content": "Set individual column widths to the specified values.  Empty column widths imply no\nmaximum width.  If the -width option is also given, then the -cwidth column widths\ncan also be given as fractions or percentages.\n\nExample: To set the maximum width of the third column to 20 characters:\n\n-cw=,,20\n"
                },
                {
                    "name": "HTML-only options (the usage of which implies -html)",
                    "content": ""
                },
                {
                    "name": "-noe(scape)",
                    "content": "Do not perform HTML escape sequences on the data; this allows embedded HTML text in\nthe data to be displayed properly with the -html option.\n"
                },
                {
                    "name": "-attributes",
                    "content": "Declare the table attributes, which are inserted into the \"TABLE\" token.  For\nexample, the option:\n\n-attributes='BORDER=0 CELLSPACING=2 CELLPADDING=4'\n\nwould cause the following HTML:\n\n<TABLE BORDER=0 CELLSPACING=2 CELLPADDING=4>\n\nThe default table attributes are:\n\n<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1>\n"
                },
                {
                    "name": "-t(itle)",
                    "content": "Set the HTML formats for the column titles.  The -titleformats (or just -tf) can\nbe given multiple times, for each column, or formats for multiple columns can be\ngiven on the same option separated by semi-colons \"\";\"\".\n\nEach fmtN can itself be multiple HTML items, separated by commas.  Each HTML\nelement can be given either as an HTML token (eg: \"\"\\<BOLD\\\">\"), or as a plain name\n(eg: \"\"BOLD\"\").\n\nFor example, here is a title format specification for three columns, where the\nfirst column title should be bold italic, the second italic, and the third italic\nin a smaller font:\n\n-tf='BOLD,I;I;<FONT SIZE=-2>,I'\n"
                },
                {
                    "name": "-d(ata)",
                    "content": "The same as -titleformats but applies to the column data.\n"
                },
                {
                    "name": "-url(s)=",
                    "content": "Define a mapping from column names, or indexes, to URLs to be inserted as <A\nHREF's> around the values for the named columns.  Each colN is a column name or\nindex, and each urlN is a string representing the URL to be inserted for the given\ncolumn.\n\nThe URL text may contain these substitution strings:\n\n%K - will be substituted with the current column name (or key).\n\n%V - will be substituted with the current column value.\n\nMultiple -url options may be given, if desired, rather than creating one long\nargument for a single -url.  For example:\n\nshowtable   -d: -f1,6 -titles=Login,Homedir \\\n-url='Login=mailto:%V' \\\n-url='HomeDir=file:%V' \\\n/etc/passwd\n"
                },
                {
                    "name": "Other options",
                    "content": ""
                },
                {
                    "name": "-help",
                    "content": ""
                },
                {
                    "name": "Boxed Input",
                    "content": "If the input type is box, then vertical and horizontal box characters are removed from the\ninput stream, and blanks surrounding the vertical box characters are removed.  The vertical\nbox characters (column separaters) are \"\"|\"\" or \"\":\"\".  The The horizontal box characters are\n\"\"+\"\" and \"\"-\"\".\n\nMorever, data wrapped within a column is recognized and parsed as one column value, by\nrecognizing the presence of a wrapping prefix or wrapping suffix character.  Currently, the\nwrapping prefix character is \"<\", and the wrapping suffix character is \">\".\n\nAn example of data wrapped within a column is given here.  The table below has just two\nlogical rows of data; with both rows having data wrapped into multiple physical rows.\n\n+---------+---------+---------+\n|  Col 1  |  Col 2  |  Col 3  |\n+---------+---------+---------+\n| This is>| Another>| Row 1,3>|\n|< a cont>|< value. |<is also>|\n|<inued  >|         |<long.   |\n|<value.  |         |         |\n|This is >| Item2-2 | Item2-3 |\n+---------+---------+---------+\n"
                },
                {
                    "name": "List Format",
                    "content": "When using the -list or -input=list options, either, or both, the input and output may be in\na \"list\" format, which is implemented using the following syntax:\n\nr1c1name: r1c1value\nr1c2name: r1c2value\n...\nr1cNname: r1cNvalue\n\nr2c1name: r2c1value\nr2c2name: r2c2value\n: r2c2valuecontinued\n...\nr2cNname: r2cNvalue\n\nrMc1name: rMc1value\nrMc2name: rMc2value\n...\nrMcNname: rMcNvalue\n\nEach row of data consists of one or more columns, and ends with a blank line.\n\nEach column consists of a column name, followed by a colon \":\", followed by an optional,\nsingle space or tab, followed by the column value, on the same line.\n\nContinuation lines of the previous column value consist of one or more space or tab\ncharacters, a colon \":\", one optional, single space or tab, followed by the continuation\nvalue.  In the example above, The second column value of the second row was continued.\n"
                },
                {
                    "name": "HTML Input with HTML Output",
                    "content": "When using -html on data already containing HTML-formatted text, the -noescape option should\nbe used.  By default, all input text is assumed not to be HTML-formatted, and is escaped\nallowing embedded \"<\", \">\" characters, if any, to be displayed correctly.\n"
                }
            ]
        },
        "DEPENDENCIES": {
            "content": "Data::ShowTable module\nPerforms the actual output formatting.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Alan K. Stebbens aks@stebbens.org\n",
            "subsections": []
        },
        "BUGS": {
            "content": "•    Currently, the box formatting characters are not configurable: '+' for the corners; '-'\nand '|' for the tops and sides, respectively.  In an ideal world, these things would be\nconfigurable.\n\n•    The continuation prefix and suffix characters, '<' and '>', respectively, are also not\nconfigurable:\n\n•    When reading table input, any data ending with \">\" will be considered to be continued by\nthe next row of data.  To avoid this, use -input=simple.\n\n•    When selecting noncontiguous fields (ie: -f1,4>) without field names, the default field\nnames will be consecutively numbered from 1, which is counter-intuitive to the original\nselection.  To avoid this, name the fields using the -title=...  option.\n\n\n\nperl v5.32.0                                 2021-01-06                                SHOWTABLE(1p)",
            "subsections": []
        }
    },
    "summary": "showtable - Show data in nicely formatted columns",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the inter-column break string to \"str\". The default is a tab (\"\"\\t\"\"). If -strip is also given, blanks surrounding the break string will also be ignored."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Do not ignore lines of separators, such as dashes, equal signs, or underlines. If -nodashes is given, and these lines do occur in the stream, they will be treated as normal data."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Treat the first NN rows of data as column titles; multiple words in the column titles may wrap vertically. If NN is omitted, it defaults to 1. No -titles option is the same as -titles=0."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the input type as type, which can be one of: box, list, table, or simple. A simple-type table is the same as a table-type, but no wrapping characters are recognized."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Do not strip blanks from the input. Useful if there is formatted or aligned data within a boxed table."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "or determined column widths. See Data::ShowTable for more details."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Data::ShowTable for more details."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Define the column names explicitly. This is useful for naming columns of data from \"STDIN\", when showtable is being used as a filter. The first column name, name1, cannot begin with a digit. This option allows any column titles obtained from the input to be overridden."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Do not output any headers on the tables; -titles=0 implies this option."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "Select fields numbered n1, n2, etc., to display. Each nN is a field index, or a range of indexes in the form: \"N\"-\"M\" 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 \"/etc/passwd\" file: showtable -d: -f1,2-5 /etc/passwd"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Select the named fields to display. The field names must be available, either through the data stream, or by using the -titles option. The field names given must match the existing field names exactly. Using the file \"/etc/passwd\" for another example: to show the same first two fields, by name: showtable -d: -titles=Login,UID -fields=Login,UID /etc/passwd"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the maximum table width. This value is applied to the variable Data::Showtable::MaxTableWidth. When the total width of all columns to be displayed exceeds this value, all column widths are scaled uniformly. If -width is not given, then for all output but -html, the default value is either \"\"COLUMNS\"\", if defined, or 80, if not. Whith -html mode, there is no default value for -width; in other words, there is no limit to the width."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set individual column widths to the specified values. Empty column widths imply no maximum width. If the -width option is also given, then the -cwidth column widths can also be given as fractions or percentages. Example: To set the maximum width of the third column to 20 characters: -cw=,,20"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Do not perform HTML escape sequences on the data; this allows embedded HTML text in the data to be displayed properly with the -html option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Declare the table attributes, which are inserted into the \"TABLE\" token. For example, the option: -attributes='BORDER=0 CELLSPACING=2 CELLPADDING=4' would cause the following HTML: <TABLE BORDER=0 CELLSPACING=2 CELLPADDING=4> The default table attributes are: <TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1>"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the HTML formats for the column titles. The -titleformats (or just -tf) can be given multiple times, for each column, or formats for multiple columns can be given on the same option separated by semi-colons \"\";\"\". Each fmtN can itself be multiple HTML items, separated by commas. Each HTML element can be given either as an HTML token (eg: \"\"\\<BOLD\\\">\"), or as a plain name (eg: \"\"BOLD\"\"). For example, here is a title format specification for three columns, where the first column title should be bold italic, the second italic, and the third italic in a smaller font: -tf='BOLD,I;I;<FONT SIZE=-2>,I'"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "The same as -titleformats but applies to the column data."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Define a mapping from column names, or indexes, to URLs to be inserted as <A HREF's> around the values for the named columns. Each colN is a column name or index, and each urlN is a string representing the URL to be inserted for the given column. The URL text may contain these substitution strings: %K - will be substituted with the current column name (or key). %V - will be substituted with the current column value. Multiple -url options may be given, if desired, rather than creating one long argument for a single -url. For example: showtable -d: -f1,6 -titles=Login,Homedir \\ -url='Login=mailto:%V' \\ -url='HomeDir=file:%V' \\ /etc/passwd"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        }
    ],
    "examples": [],
    "see_also": []
}