Current Page:
NeXtMidas Training
Working with Files
Lab 1
Instructions
|
|
- Lab 1: This lab will introduce you to using the
AUX , FILES ,
STATUS , HEADER , FNAME and DATALIST
commands.
- What you need to do:
- Use the
WAVEFORM or HEADER/CREATE command to force
a file called myfile.tmp to be created in your home directory.
- If it is not already on your read AUX list, put HOME on it. Now run the command:
nM> waveform myfile.tmp ELEM=8k
Where was the file created?
- Use the
FILES command to find the name of the shape (.shp ) file
that is located in the dat area of SYS.
- Use the
STATUS command to find out the size (number of bytes) of the
shape file in the dat area of SYS.
- Use
DATALIST to list the data in airports.csv .
- Now use
STATUS with the /d switch to list the header
and data in airports.csv . But, this time, give it the
HEADERROWS=1 qualifier, and see what happens.
- Set up an AUX called WEB and point it to
http://nextmidas.techma.com/nm/nxm/sys/dat/ . Now list the header of
the world.prm in this AUX.
- Use the
HEADER command to create the similarly named files called
temp_xxx_file.tmp , temp_yyy_file.tmp ,
temp_xyx_file.tmp , and temp_zzy_file.tmp . Then use
the FILES command to find all files starting with temp_,
with a y somewhere after the temp_ and ending with _file.
Use the FILES/E command to erase all of the files you created.
- Use
FNAME to form the path for the DAT area of the SYS option tree.
- Use
FILE to open the airports.csv file, convert it into a
table with a row prefix of R_ excluding the header, then close the file.
Hint: Find appropriate operation (e.g. toTable) to use on the
CsvFile. See the NeXtMidas explain
file for examples, FILE .
- Hints:
- Before using
airports.csv , take a look at the API for the
CsvFile class. It has
a good explanation about the HEADERROWS= qualifier.
|
|
|