Next: DEFINE VARIABLE
Up: The KEYBOARD INTERFACE: Command
Previous: CURVE STYLES
DEDUCE FILE SEQUENCE
Often it is desired to run a series of data analysis operations
on a whole series of files. This can be achieved by running a
macro on a whole series of files using the "SEQUENCE" command
(Section 15.90, Page ), or by
writing a single macro with a loop which runs on different files
(see Section 30, Page ).
When a macro is to be run on a series of files, it is necessary
to deduce the file sequence. i.e. the number of the first and
last file in the sequence, the base part of the file name, and
the file extensions. DEDUCE FILE SEQUENCE allows a starting
file name and an end file name to be entered, which may of course
be program variables, and if possible deduces the parameters of the
sequence, and sets a number of internal program variables.
- ##PREFIX : This is a character string set to the
non-changing characters at the start of the file names.
- ##START : This is an integer value from the starting file
in the series
- ##END : This is an integer value from the last file in the
series
- ##STEP : This is an integer value for the step from one
file in the series to the next. This will normally be set to 1, or
to -1 if the last file number is less than the first file number.
- ##VARIABLE : This is a logical (boolean) value
(TRUE or FALSE)
which tells whether or not the number of characters used to store
the changing numerical part is variable or fixed. e.g. file_1.dat
to file_100.dat has a variable number of characters, whereas
file_001.dat to file_100.dat has a fixed number of
characters.
- ##NUM_CHARS : When ##VARIABLE is FALSE this is
an integer value which is the number of characters used to store
the changing numerical part of the file names.
- ##POSTFIX : This is a character string with any
non-changing part of the file names
after the changing numerical part, but before any file extension.
(Often this will be blank.)
- ##EXTENSION : This is a character string with any
non-changing part of the file name after, and including the
decimal point19.
e.g. If #FILE_1ST equals /users/a/smith/data/poly_001.dat
and #FILE_LAST equals
/users/a/smith/data/poly_180.dat then:
Main menu: ENTER COMMAND [PLOT DATA]: DEDUCE
ENTER NAME OF STARTING FILE [fit2d_999.f2d]: #FILE_1ST
ENTER NAME OF END FILE [fit2d_001.f2d]: #FILE_LAST
Main menu: ENTER COMMAND [CONCATENATION]: LIST VARIABLES
##PREFIX = /users/a/smith/data/poly_
##START = 1
##END = 180
##STEP = 1
##VARIABLE = FALSE
##NUM_CHARS = 3
##POSTFIX =
##EXTENSION = .dat
This command is useful for creating macros which work with file series.
Next: DEFINE VARIABLE
Up: The KEYBOARD INTERFACE: Command
Previous: CURVE STYLES
Andrew Hammersley
2004-01-09