OOMMF Home next up previous contents index
Next: OOMMF and Process ID Up: Command Line Utilities Previous: MIF Format Conversion: mifconvert


ODT Column Extraction: odtcols

The odtcols utility extracts column subsets from ODT data table files.

Launching
The odtcols launch command is:

tclsh oommf.tcl odtcols [standard options] [-f format] \
   [-m missing] [-q] [-s] [-S] [-t output_type] [-w colwidth] \
   [col ...] <infile >outfile
where
-f format
C printf-style format string for each output item. Optional. The default format string is "%-${colwidth}s".
-m missing
String used on output to designate a missing value. Default is the two character open-close curly brace pair, { }, as specified by the ODT file format.
-q
Silences some meaningless error messages, such as "broken pipe" when using the Unix head or tail utilities.
-s
Produces a file summary instead of column extraction. Output includes table titles, column and row counts, and the header for each specified column. If no columns are specified, then the headers for all the columns are listed.
-S
Same as -s option, except the column list is ignored; headers for all columns are reported.
-t output_type
Specify the output format. Here output_type should be one of the strings odt, csv, or bare. The default is odt, the ODT file format. Selecting csv will yield a ``Comma-Separated Values'' (CSV) file, which can be read by many spreadsheet programs. The bare selection produces space separated numeric output, with no ODT header, trailer, or comment lines. The latter two options are intended as aids for transferring data to third party programs; in particular, such output is not in ODT format, and there is no support in OOMMF for translating back from CSV or bare format to ODT format.
-w colwidth
Minimum horizontal spacing to provide for each column on output. Optional. Default value is 15.
col ...
Output column selections. These may either be integers representing the position of the column in the input data (with the first column numbered as 0), or else arbitrary strings used for case-insensitive glob-style matching against the column headers. The columns are output in match order, obtained by processing the column selections from left to right. If no columns are specified then by default all columns are selected.
<infile
Odtcols reads its input from stdin. Use the redirection operator ``<'' to read input from a file.
>outfile
Odtcols writes its output to stdout. Use the redirection operator ``>'' to send the output to a file.
Commonly the -s switch is used in a first pass, to reveal the column headers; specific column selections may then be made in a second, separate invocation. If no options or columns are specified, then the help message is displayed.


OOMMF Home next up previous Contents index

OOMMF Documentation Team
September 28, 2012