ftp.nice.ch/pub/next/science/mathematics/statPerlman.5.4.N.bd.tar.gz#/stat/doc/dm.man

This is dm.man in view mode; [Download] [Up]

DM(1)                              |STAT                  November 26, 1985

NAME
     dm - data manipulation with conditional transformations

SYNOPSIS
     dm [Efile] [expressions]

DESCRIPTION
     _d_m is a data manipulating program for column extraction from files,
     possibly based on conditions, and production of algebraic combinations
     of columns.  _d_m reads whitespace separated fields on each line of its
     input.  _d_m takes a series of expressions, and for each line of the
     input, _d_m reevaluates and prints the values of those expressions.
     Numerical values of fields on a line can be accessed by the letter 'x'
     followed by a column number.  Character strings can be accessed by the
     letter 's' followed by a column number.  For example, for the input
     line:
                                    12  45.2
     s1 is the string '12', x2 is the number 45.2 (which is not the same as
     s2, the string '45.2').

     _C_o_l_u_m_n _E_x_t_r_a_c_t_i_o_n. Columns are extracted with string expressions.  To
     extract the 3rd, 8th, 1st and 2nd columns (in that order) from "file,"
     one would type:
                          dm  s3  s8  s1  s2  <  file

     _A_l_g_e_b_r_a_i_c _T_r_a_n_s_f_o_r_m_a_t_i_o_n_s. To print, in order, the sum of the columns
     1 and 2, the difference of columns 3 and 4, and the square root of the
     sum of squares of the 1st and 3rd columns, one could type the command:
                    dm  "x1+x2"  "x3-x4"  "(x1*x1+x3*x3)^.5"
     There are the usual mathematical functions that allow expressions
     like:
            dm  "exp(x1) + log(log(x2))"  "floor (x1/x2)"  "sin x1"

     _T_e_s_t_i_n_g _C_o_n_d_i_t_i_o_n_s. Expressions can be conditionally evaluated by
     comparing values.  To print the ratio of x1 and x2, and check the
     value of x2 before division and print 'error' if x2 is 0, one could
     type:
                     dm "if x2 = 0 then 'error' else x1/x2"
     To extract lines in which two columns are the same string, say the 5th
     and 2nd, one would type:
                      dm "if s5 = s2 then INPUT else NEXT"

     _O_t_h_e_r _F_e_a_t_u_r_e_s. _d_m has comparison, algebraic, and logical operators,
     and special variables to take control in exceptional conditions.
     These include: INPUT, the current input line in string form; INLINE,
     the current input line number; N, the field count in INPUT; SUM, the
     sum of the numbers in INPUT; RAND, a uniform random number different
     for each line; NIL, an expression that causes no output; NEXT, which
     terminates evaluation on INPUT and goes to the next line; and EXIT,
     which terminates all processing.

LIMITS
     Input fields longer than 15 characters are truncated silently.  The
     number of input columns, output expressions, and expression constants
     are limited to 100.

SEE ALSO
     The DM Manual in The |STAT Handbook

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.