2.2.16. addIndexed
Purpose
Add data in column(s) of mapped ASCIItable selected from the row indexed by the value in a mapping column. Row numbers start at 1.
Usage
> addIndexed options ASCII table(s)
Options
-
--index
- column label containing row index
-
-o
/ --offset
[ 0 ] - constant offset for index column value
-
-l
/ --label
- column label(s) to be appended
-
-a
/ --asciitable
- indexed ASCIItable
Examples
- add squared values
Suppose we have a reference ASCIItable containing data to which we want to add the squared values of column » y «. 2 head
# reference ASCIItable
x y
1 1
2 3
3 4
The lookup table contains 2 head
# lookup ASCIItable
squared
1
4
9
16
25
> addIndexed --index y --asciitable lookup --label squared < reference
yields 3 head
# reference ASCIItable
# addIndexed --index y --asciitable lookup --label squared
x y squared
1 1 1
2 3 9
3 4 16