Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 
Table of contents Previous: TU Next: UACROSS Index

TXT2MD

Creates an MD file from an ASCII text data file.


Format

TXT2MD sfile dfile schema [keywords]


Parameters

sfile

source ASCII text file name and extension

dfile

destination MD file number

schema

MD file schema name, for example: IRAB, ISFC


Keywords

MISS=

value representing the missing data in sfile

ROW=

row to write the data (default=first available row)


Remarks

Use command TXT2MD to convert files containing lists of data to MD files.

The sfile must be an ASCII text file with an end-of-line indicator at the end of each line. The sfile format must be columnar. The first line contains the schema key names; subsequent lines contain the corresponding data values, as shown below. Extra spaces between the columns are ignored.

TIME  ID   LAT   LON    ZS  PSL  TD   T   DAY  TYPE NREC MOD ST CO
 12  MEI  32.33 88.75   94  1009 267 272 93072  0    9    0  MS US
 12  NMM  32.55 88.56   97  1009 268 270 93072  0    9    0  MS US
 12  JAN  32.31 90.08  101  1015 265 273 93072  0    9    0  MS US
 12  MCB  31.18 90.46  126  1015 272 272 93072  0    9    0  MS US
 12  GWO  33.50 90.08   47  1014 264 273 93072  0    9    0  MS US
 12  CBM  33.65 88.45   67  1009 268 270 93072  0    9    0  MS US
 12  TUP  34.26 88.76  110  1010 265 272 93072  0    9    0  MS US
 12  GPT  30.40 89.06    9  1011 268 274 93072  0    9    0  MS US
 12  BIX  30.41 88.91   10  1011 269 273 93072  0    9    0  MS US

Each data line in sfile is placed into one record in dfile . If repeat groups are defined in the schema, each data line must also include the data to be stored in the record's repeat groups.

If dfile does not exist, it will be created. If it already exists, the data is appended to the first available row or the row specified with keyword ROW. If you use keyword ROW, any column in the dfile row matching a column header from sfile will be replaced. If the column headers in sfile do not match the column headers in dfile , the data is appended to new columns at the end of the row.

The values for the row header keys in dfile , such as DAY and TIME, are set to the values found in the first data line of sfile . Values of the row header keys in subsequent data lines in sfile are ignored.

If the dfile schema has a key that represents time, such as HMS and TIME in the ISFC schema, it must be specified using the HH, HH:MM, or HH:MM:SS formats in sfile . For example, 12:00:00 UTC must be in the format 12, 12:00, or 12:00:00.

The dfile cannot have more than six column header keys or 7000 columns. Each record in dfile , including repeat groups in that record, cannot contain more than 64 keys.


See Also

See commands LSCHE and SCHE. Also see Registering MD File Schemas .


Examples

TXT2MD UPPRDATA.TXT 15 IRAB

This entry reads the ASCII text file UPPRDATA.TXT and puts it into MD file 15 of schema IRAB.

TXT2MD SFCDATA.TXT 5 ISFC MISS=-999

This entry reads the ASCII text file SFCDATA.TXT and puts it into MD file 5 of schema ISFC. Any data value set to -999 in SFCDATA.TXT is treated as missing when it is read into the MD file.

TXT2MD TEMPDATA 100 TEMP ROW=5

This entry reads the ASCII text file TEMPDATA and puts it into row 5 of MD file 100. TEMP is an MD file schema created and registered by the user.

 


Table of contents Previous: TU Next: UACROSS Index
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690