INVERT

Section: User Commands (1)
Updated: 1. April 1989
 

NAME

invert - matrix data to (z,x,y)-style data.  

SYNOPSIS

invert [ < data ]  

DESCRIPTION

invert reads a matrix-style table and outputs a three-column table.

The contents of the table can be any real numbers.

This is best explained by way of an example. Suppose the file data contains the lines:

y       1       2       3       4
-       -       -       -       -
2       1       0       0       0
3       1       0       0       0
4       0       0       2       0
5       0       0       0       2
6       0       0       0       2
where exactly one tab-character separates the columns.

The command invert < data yields

col     x       y 
---     -       -
1       1       2
1       1       3
2       3       4
2       4       5
2       4       6
on the standard output.  

SEE ALSO

reldb(1), matrix(1).  

BUGS

Invert uses awk to do its work. This makes for easy programming, but at a cost in efficiency. Usually, tables are small and this is not a problem.