TEXREAD

Read text from text file


EnvironmentsPYTHON :: EASI :: MODELER
Batch ModeYes
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Related

Back to top

Description


Reads text from an input text file and writes it to a text segment in a PCIDSK imag file.
Back to top

Parameters


Name Type Length Value range
Output Integer 0 - 1  
Text Form String 0 - 1 ATT | FREE
Default: FREE
Text Layer Name String 0 -   Default: TEXREAD
Text Layer Description String 0 - 1  
Input Text File * String 1 -    
LASC Integer 0 - 1  

* Required parameter
Back to top

Parameter descriptions

Output

Specifies the text segment (type 140:TEX) to receive the input text. If this parameter is not specified, a new text segment is created.

Text Form

Specifies whether the text data should be checked for a valid attribute format. This is important if the text data will be used as attribute data by other programs.

Available options are:

If set to ATT, a warning is printed for each format error found in the text file. Text data is still read to the text segment, unchanged.

For more information about the the Attribute data format, see the Details section.

Text Layer Name

Specifies a name (up to 8 characters) for the output text segment.

This parameter is required only if a new segment is created.

Text Layer Description

Describes (in up to 64 characters) the contents or origins of the output data.

This parameter is used only if a new segment is created.

Input Text File

Specifies the name of the text file from which text data is read.

LASC

This is an output parameter and requires no user input. If a new output segment is created, LASC is assigned the number for the new segment, after the function has finished executing.

Back to top

Details

TEXREAD reads text data from a specified text file (TFILE) to a text segment (TEXSEG) in a PCIDSK file (FILE). Text segments can be used to store free-form lines of text; for example, a text segment may contain descriptions and reports, or an EASI procedure to be used with imagery stored on the file. The most common use for text segments, however, is to store attribute data.

If the output text segment (TEXSEG) is not specified, a new segment is created using the specified name (DBSN) and description (DBSD). If the text segment is specified, DBSN and DBSD are ignored.

Text data can be checked to ensure that it conforms to the syntax of attribute data (TEXFORM="ATT"), or just read in directly as free-form text (TEXFORM="FREE").

Trailing blanks are removed, and leading blanks are retained.

Attribute data

Attribute data is made up of lines of text. Each line is either a comment or data. The components of an attribute text segment are described below.

Comment lines

COMMENT lines begin with a '!' (exclamation). There can be any number of comment lines and comment lines can appear anywhere. For example:

! This is a comment line

Data lines

DATA lines have the following three parts:
RANGE specifies the range of values associated with the attribute list. Attribute lines MUST be ordered with ascending ranges and ranges must not overlap. The following range forms are available:
Note: If specified, the special range form ':' must be the last line of attribute data in the text file.

ATTRIBUTE LIST is the list of attribute data associated with each range. It can consists of up to 64 numeric and/or character values separated by spaces. Although numeric and character values can be mixed in any order, the order -- once established -- must be maintained in the rest of the attribute lines. Each data line must have the same number of attributes.

Character attributes begin with a non-digit character or they are enclosed in quotes. Example attribute data lines are:

1     2     ABC     A     53.0 
0.1   3     '1AB'   C     1.0E25

Keep in mind that the appearance of the list of attributes (that is, their spacing) is determined by the spacing you assign when you create the text file.

The DESCRIPTION is optional free-form text at the end of a line of data which describes the attributes listed in the line. Descriptions are not required to be enclosed in quotes but must be separated from the list of attributes by a semicolon (;). Examples of free form descriptions are:

; data provided by USGS
; data N/A - value from previous year
; benchmark site
			

See the Examples section for an Attribute example.

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