dump_table (version 2.0)

You can also look at:
#! /usr/bin/perl

##############################################################################
#
# SYNTAX: dump_table file columns1 column2 column3 ...
#
# DESCRIPTION: This utility dumps specified columns of a
# DESCRIPTION: FITS table to the standard output.
# DESCRIPTION: This is basically just a wrapper for the fdump FTOOL.
#
# VERSION: 2.0
#
# HISTORY: 0.0 -> 1.0
# HISTORY: Added a "grep" to remove blank lines.
# HISTORY: 
# HISTORY: 1.0 -> 2.0 1999-05-07
# HISTORY: Converted from ksh to perl
#
# CALLS: $UTIL/setup_parfile
# CALLS: $UTIL/ftool_test
# CALLS: $FTOOL/fdump
#
##############################################################################
#$DEBUG=1;

$table = $ARGV[0];

$UTIL = $ENV{"UTIL"};
$FTOOL = $ENV{"FTOOL"};

########################
# Read the column list
########################
shift;
@columns = @ARGV;

#############################
# debugging output
#############################
if ($DEBUG) {
    print "columns=@columns\n";
    print "table=$table\n";
}


`$UTIL/setup_parfile $FTOOL/fdump.par    infile=$table       \\
                                         outfile=STDOUT      \\
                                         rows=-              \\
                                         columns="@columns"  \\
                                         prhead=no           \\
                                         prdata=yes          \\
                                         showcol=no          \\
                                         showunit=no         \\
                                         showscale=no        \\
                                         showrow=no          \\
                                         page=no             \\
                                         wrap=no             \\
                                         align=no            \\
                                         pagewidth=256`;

system("$FTOOL/fdump 2>stderr$$.log |grep -v '^ *\$' ");
`$UTIL/ftool_test fdump 0 $0 2 "" stderr$$.log`;

exit 0;