1
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2
%.COPYRIGHT (c) 1990-2008 European Southern Observatory
5
%.KEYWORDS MIDAS, help files, CREATE/TABLE
6
%.PURPOSE On-line help file for the command: CREATE/TABLE
7
%.VERSION 1.0 12-AUG-1984 : Creation, JDP
8
%.VERSION 1.1 04-Mar-1991 : New Table Version
9
%----------------------------------------------------------------
13
CREATE/TABLE 10-APR-2012 JDP,KB
15
CREATE/TABLE table ncol nrow data_file [format_file] [organization]
16
create a table from ASCII data
19
Create a table and load values from an ASCII data file.
20
Format conversion is controlled by an auxiliary format file.
21
If the table contains only numerical columns and no NULL values
22
are present, the format file can be omitted.
25
CREATE/TABLE table ncol nrow data_file [format_file] [organization]
27
table = the table name
29
ncol = number of columns; * if ncol defined in format_file.
31
nrow = number of rows; * if nrow defined in format_file.
33
file = file name (default type .dat) with the data to be
35
All lines of the ASCII file will appear as table rows,
36
even if it has more lines than the parameter nrow.
37
Then, additional rows are allocated.
38
The filename NULL produces an empty table (disk space is
39
allocated - no columns are created; use CREATE/COL to create
41
First char. # indicates comment lines.
43
format_file = optional filename (default type .fmt) to define
44
the format of the ASCII data file, and the size of the
45
table when ncol and/or nrow are *. By default the
46
name "table.fmt" is used. If the format file does not exist,
47
the conversion is done via list-directed input, free format,
48
and the labels are defaulted to LABxxx.
50
organization = optional file organization, as
51
RECORD (table stored row per row) or
52
TRANSPOSED (table stored columnwise) (default).
53
!OJO! Not all MIDAS commands will work on tables organized
57
All lines of the data file beginning with the char. `#' or `!'
58
are interpreted as comment and ignored.
60
The format file describes each field (column) in the table ASCII
62
DEFINE/FIELD [pos1] [pos2] type [format] label [unit]
64
pos1 = starting position of the field
65
pos2 = last position in the field
66
type = data type of the field as I - integer,
67
R - real single precision,
68
D - real double precision,
70
format = optional FORTRAN format
71
label = column label associated to that field
74
Three keywords can also be added at the beginning of the format
76
ROWS number_of__rows (if not specified in the command line)
77
COLUMNS number_of_columns (if not specified in the command line)
78
FS list of field separators used in the ASCII data file.
79
Only used when pos1 and pos2 are not specified in the
80
DEFINE/FIELD statement. Per default tabs and blanks are
81
used as field separators. The list of separators has to
82
be written in the form "f1f2f3". The number of field
83
separators is not limited. If the blank is used as field
84
separator, character strings containing blanks have
85
to be enclosed within double quotes.
87
The max. no. of columns is set to 256. If you really need tables
88
with more columns, you have to update the definition of
89
MAXCOL in the file /midas/version/prim/table/libsrc/tbaload.c
90
(look for the line starting with "#define MAXCOL ...").
91
The safest option is to reinstall Midas after you've done your
95
CREATE/COLUMN, CREATE/VIRTUAL, DELETE/COLUMN, WRITE/TABLE
96
COMPUTE/TABLE, SELECT/TABLE, COPY/TABLE, PROJECT/TABLE,
101
CREATE/TABLE mytable 5 1000 myfile format
102
Create the table `mytable.tbl' from ASCII data in the
103
file `myfile.dat', using the format in `format.fmt'
104
The ASCII file `myfile.dat' could contain the following
106
.........1.........2.........3
107
123456789012345678901234567890
108
NGC 3379 10.75 12.85 E 893
109
The associated file `format.fmt' is defined as:
111
DEFINE/FIELD 5 8 I :NAME "NGC"
112
DEFINE/FIELD 10 14 R F5.2 :RA "HOUR"
113
DEFINE/FIELD 16 20 R F5.2 :DEC "DEGREE"
114
DEFINE/FIELD 22 22 C :TYPE
115
DEFINE/FIELD 24 26 I :RV
118
CREATE/TABLE waldi 3 1000 waldi waldi
119
Generates `waldi.tbl' from the ASCII file `waldi.dat' using
120
the format file `waldi.fmt' which is defined as:
124
DEFINE/FIELD C*13 :NAME
125
No field positions are given, tabs and commas are used as field
127
The file `waldi.dat' has the following structure:
128
0.0047,-35.0596 MS2357-3520
129
0.0286,-63.5943 MS2357-6352
130
0.0499,0.0401 Q 2357-0014
131
0.0528,-0.2427 Q 2357-005A
133
CREATE/TABLE table 4 100 data
134
Generates `table.tbl' from the ASCII file `data.dat' without
135
associated format file. The information in the file `data.dat'
136
is in free format (list-directed read in FORTRAN) as: