NAME

rdb2tml - translate an RDB table into a TML table


SYNOPSIS

rdb2tml options [ input [ output ] ]


DESCRIPTION

rdb2tml translates an RDB table into TWiki Markup Language (TML), which is used by TWiki and Foswiki. It can be used as a filter, reading from the standard input stream, and writing to the stdandard output stream. It uses the TWiki and Foswiki TablePlugin to perform formatting and provide for interactive sorting.

The alignment of the columns may be determined from the RDB table or may be specified via the command line, as can all of the TablePlugin attributes. Additionally, rdb2tml can render complex column groupings.

Multi-level headers

Columns may be grouped hierarchically:

   |   a   | b |
   | 1 | 2 |   |
   --------------
   | x | x | x |

rdb2tml is able to render this relationship if the column names encode the levels in the heirarchy. If the --multi option is specified, column names are treated as lists of levels, separated by the value of the --ldelim. In the above example, this would be

  a:1 a:2 b

(using the default delimiter, :). Level names may be any string, provided it doesn't included the delimiter string.

Columns will be reordered to ensure the correct spatial relationship in the output.

The TablePlugin requires that the last header line be fully populated for sorting to work, so if the --sort option is specified, column names are moved to the lowest level required to do so. The above example would be rendered as

   |   a   |   |
   | 1 | 2 | b |
   --------------
   | x | x | x |


OPTIONS AND ARGUMENTS

Arguments

The input and output files may be specified on the command line rather than with the --input and --output options. Note that it is impossible to specify just the output file in this manner.

Options

Options may be abbreviated. Options which take values may be separated from the values by either an equals sign or by white space.

--input filename

The input RDB table to convert. If not specified either here or on the command line, the standard input stream is used.

--output filename

Where to write the output TML table. If not specified either here or on the command line, the standard output stream is used.

--comments

Include the RDB table comments in the output. It is wrapped in a < <pre</pre> >> block.

--multi

If specified, column names are split into levels based upon the value of the --ldelim option.

--ldelim string

The delimiter between levels in a multi-level column name. It defaults to the : character.

--version

Output version information and exit.

--usage

Output very short usage information and exit.

-h | --help

Output short usage information and exit.

--man

Output full usage information and exit.

TablePlugin Attributes

All of the attributes available via the TWiki and Foswiki TablePlugin are available as options. Simply prefix the TablePlugin attribute name with --. For example:

  rdb2ml --initdirection down file.rdb

The following options have slightly different usage or behavior:

--sort | --nosort

This option takes no arguments; it specifies whether or not TablePlugin should provide for interactive sorting of the table. Sorting is turned on by default if multi-level header encoding is not enabled or if the table does not have multi-level headers.

--headerrows integer

If this is not specified, rdb2tml will calculate the number of header rows based upon the number of levels deduced from the column names (if --multi is specified).

--dataalign alignment list

This specifies one or more horizontal alignments for the columns. If no alignment is specified for a particular column (if --dataalign is not specified, or if a list of alignments is specified with empty fields) column alignments are ased upon the alignments specified in the RDB table, or if those are not present, the column types.


BUGS

None reported.


COPYRIGHT AND LICENSE

Copyright 2008 The Smithsonian Astrophysical Observatory. rdb2tml is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.


VERSION

@VERSION@


AUTHOR

Diab Jerius ( djerius@cfa.harvard.edu )