v input view args... access specifiers
Get is the workhorse operator for extracting values from a view. The type of the result depends on which arguments are specified, in particular which column is being accessed.
Here is a summary of the different arguments allowed:
Get row col => extract one value
Get row * => extract one row, all columns
Get row => extract one row, include column names
Get * col => extract all rows, one column
Get * * => extract all values as a single list
Get * => extract all values as a list of lists
Get # => return the number of rows
Get @ => return the meta view
If more arguments are specified, these will be applied in order as if multiple get operators were chained together.
Note that this makes get a replacement for several other operators, such as {getcol}, {meta}, {names}, {size}, {types}, and {width}.
Examples:set v [view {A B} def {a b aa bb aaa bbb}]
view $v get
a b aa bb aaa bbbview $v get 1 B
bbview $v get 2 0
aaaview $v get -1 -1
bbbview $v get * B
b bb bbbview $v get 1 *
aa bbview $v get 1
A aa B bbview $v get *
{a b} {aa bb} {aaa bbb}view $v get #
3view $v get @
view $v get @ #
name type subv 0 A S
name type subv 1 B S
name type subv
2view $v get @ @
view $v get @ @ #
name type subv 0 name S
name type subv 1 type S
name type subv 2 subv V
name type subv
3