Keywords: teapot

# Batch functions

Besides interactive facilities, teapot has a batch mode. Using this batch mode, shell scripts can generate output from teapot sheets. This is handy if you use make(1) to generate a bigger document containing tables, because you don't have to generate a tbl or LATEX file each time you modified a sheet: make will do so. In batch mode, teapot reads batch commands from standard input. The following commands are available:

`goto` location
  Go to the specified location.
`from` location
  Start marking a block.
`to` location
  End marking a block.
`sort-x` d|a y z [ d|a y z ... ]
`sort-`y d|a x z [ d|a x z ... ]
`sort-`z d|a x y [ d|a x y ... ]
  Sorts the marked block as described in section sub:Sort, column-wise, row-wise or depth-wise, respectivly. d or a specify the sort order to be descending or ascending. x, y and z specify the position of the sort key `relative` to the first cell of the marked block. Up to eight sort keys can be specified. This example reproduces the result from section 5.2.6:

  > `echo`
  > `from &(1,1,0)`
  > `to &(2,4,0)`
  > `sort-y d 0 0`
  > `save-csv result_num.txt`
  > `| teapot -b doc/unsorted`

`save-tbl` file
`save-csv` file
`save-latex` file
`save-context` file
`save-html` file
  Save the marked block in the specified format as file.
`load-csv` file
  Load file in the specified format to the last `goto` location. This is the same functionality as the interactive load described in subsection 5.12.4.