-
Notifications
You must be signed in to change notification settings - Fork 23
length_vals
Martin Asser Hansen edited this page Oct 2, 2015
·
5 revisions
length_vals appends the length of the value for specified keys for each record.
For each specified key, key of the type <key>_LEN
with the value length is added
to the record.
... | length_vals [options]
[-? | --help] # Print full usage description.
[-k <list> | --keys=<list>] # Comma separated list of keys.
[-I <file!> | --stream_in=<file!>] # Read input from stream file - Default=STDIN
[-O <file> | --stream_out=<file>] # Write output to stream file - Default=STDOUT
[-v | --verbose] # Verbose output.
Consider the following table in the file test.tab
:
Human 123
Dog 45
Mouse 6
To find the length of all values in both columns, read in the table with read_tab and then pipe to length_vals:
read_tab -i test.tab | length_vals -k V0,V1
V1_LEN: 3
V0_LEN: 5
V0: Human
V1: 123
---
V1_LEN: 2
V0_LEN: 3
V0: Dog
V1: 45
---
V1_LEN: 1
V0_LEN: 5
V0: Mouse
V1: 6
---
Martin Asser Hansen - Copyright (C) - All rights reserved.
August 2007
GNU General Public License version 2
http://www.gnu.org/copyleft/gpl.html
length_vals is part of the Biopieces framework.