.TH STILTS-TPIPE 1 "Mar 2017" "" "Stilts commands" .SH NAME stilts-tpipe \- Performs pipeline processing on a table .SH SYNOPSIS .ad l .HP 13 .hy 0 \fBstilts tpipe\fR [ifmt=\fI\fR] [istream=\fItrue|false\fR] [in=\fI\fR] [cmd=\fI\fR] [omode=\fIout|meta|stats|count|checksum|cgi|discard|topcat|samp|tosql|gui\fR] [out=\fI\fR] [ofmt=\fI\fR] .hy .ad .SH DESCRIPTION .PP \fItpipe\fR performs all kinds of general purpose manipulations which take one table as input. It is extremely flexible, and can do the following things amongst others: .RS 2 .IP * 2 calculate statistics .IP * 2 display metadata .IP * 2 select rows in various ways, including algebraically .IP * 2 define new columns as algebraic functions of old ones .IP * 2 delete or rearrange columns .IP * 2 sort rows .IP * 2 convert between table formats .RE and combine these operations. You can think of it as a supercharged table copying tool. .PP The basic operation of \fItpipe\fR is that it reads an input table, performs zero or more processing steps on it, and then does something with the output. There are therefore three classes of things you need to tell it when it runs: .TP Input table location Specified by the \fIin\fR, \fIifmt\fR and \fIistream\fR parameters. .TP Processing steps Either provide a string giving steps as the value of one or more \fIcmd\fR parameters, or the name of a file containing the steps using the \fIscript\fR parameter. The steps that you can perform are described in SUN/256. .TP Output table destination What happens to the output table is determined by the value of the \fIomode\fR parameter. By default, \fIomode=out\fR, in which case the table is written to a new table file in a format determined by \fIofmt\fR. However, you can do other things with the result such as calculate the per-column statistics (\fIomode=stats\fR), view only the table and column metadata (\fIomode=meta\fR), display it directly in TOPCAT (\fIomode=topcat\fR) etc. See SUN/256 for a more detailed explanation of these ideas. .PP The parameters mentioned above are listed in detail in the next section. .SH OPTIONS .TP \fBifmt=\fI\fR .RS Specifies the format of the input table as specified by parameter \fIin\fR. The known formats are listed in SUN/256. This flag can be used if you know what format your table is in. If it has the special value \fI(auto)\fR (the default), then an attempt will be made to detect the format of the table automatically. This cannot always be done correctly however, in which case the program will exit with an error explaining which formats were attempted. This parameter is ignored for scheme-specified tables. .RE .TP \fBistream=\fItrue|false\fR .RS If set true, the input table specified by the \fIin\fR parameter will be read as a stream. It is necessary to give the \fIifmt\fR parameter in this case. Depending on the required operations and processing mode, this may cause the read to fail (sometimes it is necessary to read the table more than once). It is not normally necessary to set this flag; in most cases the data will be streamed automatically if that is the best thing to do. However it can sometimes result in less resource usage when processing large files in certain formats (such as VOTable). This parameter is ignored for scheme-specified tables. .RE .TP \fBin=\fI
\fR .RS The location of the input table. This may take one of the following forms: .RS 2 .IP * 2 A filename. .IP * 2 A URL. .IP * 2 The special value "\fI-\fR", meaning standard input. In this case the input format must be given explicitly using the \fIifmt\fR parameter. Note that not all formats can be streamed in this way. .IP * 2 A scheme specification of the form \fI::\fR. .IP * 2 A system command line with either a "\fI<\fR" character at the start, or a "\fI|\fR" character at the end ("\fI\fR .RS Specifies processing to be performed on the input table as specified by parameter \fIin\fR, before any other processing has taken place. The value of this parameter is one or more of the filter commands described in SUN/256. If more than one is given, they must be separated by semicolon characters (";"). This parameter can be repeated multiple times on the same command line to build up a list of processing steps. The sequence of commands given in this way defines the processing pipeline which is performed on the table. .PP Commands may alteratively be supplied in an external file, by using the indirection character '@'. Thus a value of "\fI@filename\fR" causes the file \fIfilename\fR to be read for a list of filter commands to execute. The commands in the file may be separated by newline characters and/or semicolons, and lines which are blank or which start with a '\fI#\fR' character are ignored. .RE .TP \fBomode=\fIout|meta|stats|count|checksum|cgi|discard|topcat|samp|tosql|gui\fR .RS The mode in which the result table will be output. The default mode is \fIout\fR, which means that the result will be written as a new table to disk or elsewhere, as determined by the \fIout\fR and \fIofmt\fR parameters. However, there are other possibilities, which correspond to uses to which a table can be put other than outputting it, such as displaying metadata, calculating statistics, or populating a table in an SQL database. For some values of this parameter, additional parameters (\fI\fR) are required to determine the exact behaviour. .PP Possible values are .RS 2 .IP * 2 \fIout\fR .IP * 2 \fImeta\fR .IP * 2 \fIstats\fR .IP * 2 \fIcount\fR .IP * 2 \fIchecksum\fR .IP * 2 \fIcgi\fR .IP * 2 \fIdiscard\fR .IP * 2 \fItopcat\fR .IP * 2 \fIsamp\fR .IP * 2 \fItosql\fR .IP * 2 \fIgui\fR .RE Use the \fIhelp=omode\fR flag or see SUN/256 for more information. .RE .TP \fBout=\fI\fR .RS The location of the output table. This is usually a filename to write to. If it is equal to the special value "-" (the default) the output table will be written to standard output. .PP This parameter must only be given if \fIomode\fR has its default value of "\fIout\fR". .RE .TP \fBofmt=\fI\fR .RS Specifies the format in which the output table will be written (one of the ones in SUN/256 - matching is case-insensitive and you can use just the first few letters). If it has the special value "\fI(auto)\fR" (the default), then the output filename will be examined to try to guess what sort of file is required usually by looking at the extension. If it's not obvious from the filename what output format is intended, an error will result. .PP This parameter must only be given if \fIomode\fR has its default value of "\fIout\fR". .RE .SH SEE ALSO \fBstilts\fR(1) .PP If the package stilts-doc is installed, the full documentation \fBSUN/256\fR is available in HTML format: .br \%file:///usr/share/doc/stilts/sun256/index.html .SH VERSION STILTS version 3.4.7-debian .PP This is the Debian version of Stilts, which lack the support of some file formats and network protocols. For differences see .br \%file:///usr/share/doc/stilts/README.Debian .SH AUTHOR Mark Taylor (Bristol University)