PRMREAD

Read parameter values from text file


EnvironmentsPYTHON :: EASI
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example

Back to top

Description


Reads the contents of a one-line text file and assigns the contents to a parameter in the parameter file. For numeric parameters, this is 1 to 16 decoded real values; for string parameters, this is 1 to 64 characters.
Back to top

Parameters


prmread(parmname, tfile)

Name Type Caption Length Value range
PARMNAME * str Parameter name 1 - 8  
TFILE * str Text file 1 -    

* Required parameter
Back to top

Parameter descriptions

PARMNAME

Specifies the name of the parameter in the parameter file to which the new value will be assigned.

TFILE

Specifies the name of the input text file from which the parameter value is read.

Back to top

Details

PRMREAD was written to temporarily fulfill requirements in bidding a project with EDS. This requirement was the need to allow the EDS GDS GIS system to transfer values to an algorithm.

PRMREAD is used to read values into a parameter (PARMNAME) in the parameter file. For numeric parameters, this is 1 to 16 decoded real values; for string parameters, this is 1 to 64 characters. The values to be assigned are passed in a one-line text file (TFILE). Only one parameter can be read at a time.

If the parameter (PARMNAME) is numeric, the line of text is decoded into 0 to 16 values. Values can be integer or real, and must be separated by blanks (no commas). Because PRMREAD does not check for errors, if the text file does not contain valid numbers, no error will be reported and the contents of the parameter will be unpredictable.

If the parameter (PARMNAME) is string, the first 0 to 64 characters, or the characters up to the first new line (<cr>) in the text file will be assigned to the parameter.

This functionality can also be implemented by using the TEXREAD or TEXGET algorithms and data type conversion functions using the programming environment to decode values.

Back to top

Example

The file values.txt contains the following single line of text:

56  89.6   0

Assign these values to the numeric parameter NUM1.

Note: Values can be separated by any number of blanks; they must not be separated by commas.
from pci.prmread import prmread

tfile='values.txt'
parmname='NUM1'

prmread( tfile, parmname )

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.