getcol
Command Line Arguments

filename
Name of a ASCII table file. At least one of these must be present for any values to be printed. If it is stdin or STDIN, an ASCII table is expected as standard input. If there is no input file, standard input is assumed.
@filename
Name of a file containing a list of ASCII table files. If this is present, any other file names on the command line will be ignored.
field range
Print value of these columns for the number of lines of the table specified by the -n argument after the skippiing the number of lines specified by the -s argument. A value of 0 causes the entire input line to be printed.
conditions
List only lines for which these conditions are met.
The format is [n1][=#><][n2 or constant with .].
> (greater than) and < (less than) have to be escaped on the shell command line with backslashes. # means not equal; = means equal
n1 is a column number from 1 through the total number of columns on a line.
n2 is a column number if it is an integer number, a string, or a numeric constant if it is a floating point number.
If the contents of column n1 are an integer and n2 is a floating point number, n2 is converted to an integer before comparing it to n1.
-a
Sum all numeric columns selected, printing the sum on the line following the result. Columns with no sum are filled with ___. (Added in version 2.6.9)
-m
Compute the means of all numeric columns selected, printing the mean on the line following the result (or the line following the sum if -a is used). Columns with no mean are filled with ___. (Added in version 2.6.9)
-n num
Print selected columns for this many lines. If not specified, up to 100,000 lines will be read after the number of lines specified by -s have been skipped.
-r @listfile
-r line range
Print columns from the lines specified as either the first nonzero number on each line of the file listfile or the comma- and hyphen- delimitied range; i.e. 1-5,10-12 will print values from lines 1, 2, 3, 4, 5, 10, 11, and 12. (added in version 2.6.12)
-s num
Skip this many line before starting to print values. If not specified, no lines will be skipped.
-v
Print more information about process. See example 2.

Last updated 03 August 2018 by Jessica Mink

Telescope Data Center