PACKAGE | |STAT Data Manipulation and Analysis, by Gary Perlman |
---|---|
NAME | colex - column/field extraction/formatting |
SYNOPSIS | colex [-cfiqtv] [-F format] column numbers |
DESCRIPTION |
colex extracts the named columns (fixed columns or space-separated
fields) from the standard input and prints each, optionally followed
by tabs. Column numbers begin with 1. Ranges of column numbers can
be abbreviated with arguments of the form #-# (e.g., 12-24). Column
ranges can be in reverse order (e.g., 5-1 to reverse the first five
columns).
Optionally, colex will format output columns as integers, numbers with decimal points, or as numbers in exponential (scientific) notation, instead of the default of printing the columns as alphabetic fields. A format specification precedes the column range and is indicated by a single letter: a (alphabetic), e (exponential), i (integer), and n (numeric). Each format can be preceded by an optional width and/or a precision. The width tells how wide the field should be. The precision tells how many digits after the decimal point should be printed for real numbers, or the maximum width for alphabetic fields. The general form is: [[width][.precision]format][column range]See the examples for simple cases. C programmers will recognize the format as that used by the standard formatted printing functions. |
OPTIONS |
The following standard help options are supported. The program exits after displaying the help.
|
EXAMPLES |
colex 1 2 3 4 # columns 1 through 4 colex 1-4 # an abbreviation of the above colex 4-1 # columns 4-1 in reverse order colex -i 100-1 # reverse the columns ignoring missing columns colex 10.2n1-5 # columns 1-5, 10-wide, with 2 digits after decimal place colex -F 10.2n 5-2 # columns 5-2 in 10.2n format colex 4i1 5.2n2-3 10a4# column 1 as a 4-wide integer, # columns 2-3 as 5-wide numbers with 2 decimal digits, # and column 4 as a 10-wide alphabetic string colex -tc 12-14 # extract characters 12-14 (3 characters wide) |
LIMITS | Use the -L option to determine the program limits. |
SEE ALSO |
linex for line extraction.
dm for more sophisticated line or colum extraction. |
UPDATED | September 23, 1990 |