getcol Examples

1. Print Usage Instructions

Print basic instructions for use of this program by typing only the program name.
$ getcol
GETCOL 2.6.8, 1 November 1999, Jessica Mink SAO
Extract specified columns from an ASCII file
Usage: [-tv] filenme
  -r: Number of lines to read, if not all
  -s: Number of lines to skip
  -v: Verbose
$

2. Verbose Mode

Print the first and second columns from an ASCII table in verbose mode.
$ getcol -v test.list 1,2
GETCOL 2.6.8, 1 November 1999, Jessica Mink SAO
619.11 75.51
630.89 77.56
771.60 878.73
483.14 914.22
749.30 126.88
852.72 503.83
950.09 605.59
107.54 284.63
402.35 6.04
1.93 76.22
$

3. Default Output Format

Print the first and second columns from an ASCII table
$ getcol test.list 1,2
619.11 75.51
630.89 77.56
771.60 878.73
483.14 914.22
749.30 126.88
852.72 503.83
950.09 605.59
107.54 284.63
402.35 6.04
1.93 76.22
$

4. Print Selected Lines

Print 2 lines of an ASCII table after skipping 5 lines
$ getcol -s 5 -r 2 test.list
   619.11     75.51 -17.7585
   630.89     77.56 -16.9450
$

5. Print Selected Entries on Selected Lines

Print the first and second columns from an ASCII table on 2 lines after skipping 5 lines
$ getcol -s 5 -r 2 test.list 1,2
852.72 503.83
950.09 605.59
$

6. Find Total and Mean Lengths of Files

Use ls -l to list files, extract length column, and total it.
$ ls -l *.html | getcol -acm stdin | tail -3
335188.000000
3683.384615
91
$

Last updated 03 August 2018 by Jessica Mink

Telescope Data Center