diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /noao/digiphot/ptools/tbdump.cl | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/digiphot/ptools/tbdump.cl')
-rw-r--r-- | noao/digiphot/ptools/tbdump.cl | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/noao/digiphot/ptools/tbdump.cl b/noao/digiphot/ptools/tbdump.cl new file mode 100644 index 00000000..f3482a5f --- /dev/null +++ b/noao/digiphot/ptools/tbdump.cl @@ -0,0 +1,44 @@ +# TBDUMP -- Dump selected columns of an APPHOT/DAOPHOT STSDAS table database. + +procedure tbdump (tables, fields, expr) + +file tables {prompt = "Input apphot/daophot tables database(s)"} +string fields {"", prompt = "Fields to be extracted"} +string expr {"yes", prompt = "Boolean expression for record selection"} +file datafile {"STDOUT", prompt = "Output file for table data"} +file cdfile {"", prompt = "Output file for table column definitions"} +file pfile {"", prompt = "Output file for table header parameters"} +string rows {"-", prompt = "Range of rows to dump"} +int pagwidth {158, prompt = "Output page width"} + +struct *inlist + +begin + # Declare local variables + file ttables + string tfields, texpr, tmpin, tmpout, inname + + # Get the positional parameters. + ttables = tables + tfields = fields + texpr = expr + + tmpin = mktemp ("tmp$") + files (ttables, sort=no, > tmpin) + + inlist = tmpin + while (fscan (inlist, inname) != EOF) { + if (texpr != "yes") { + tmpout = mktemp ("tmp$") + tselect (inname, tmpout, texpr) + tdump (tmpout, cdfile=cdfile, pfile=pfile, datafile=datafile, + columns=tfields, rows=rows, pwidth=pagwidth) + tdelete (tmpout, ver-, >& "dev$null") + } else { + tdump (inname, cdfile=cdfile, pfile=pfile, datafile=datafile, + columns=tfields, rows=rows, pwidth=pagwidth) + } + } + delete (tmpin, ver-, >& "dev$null") + inlist = "" +end |