Reading a text file

Use text format to read a text file. First open the text file in an editor (e.g. Notepad) and study the contents. Find out column numbers, types (code field, coordinate, attribute) and field widths.

There are three basic types:

1. Constant width fields

Example:

!23456789012345678900123456789001234567890
      98     312   97193.356   44322.792
      99           97193.356   44322.792  ISO
     100      10   97193.356   44322.792

field width content

1. 8 point number

2. 8 feature code

3. 12 X-coordinate

4. 12 Y-coordinate

5. 20 COMMENT (attribute)

Add a new converter (File/Formats/Vector file) with function Text and give format definition in Other-dialog: T3@8 T4@8 X@12 Y@12 COMMENT (use space as separator).

2. Variable field width

Read in just like above, but all fields must have a value (can not be empty).

Example:

98  312  97193.356 44322.792
1023  0  97193.356  44322.792  ISO
3  10  97193.356  44322.792

field content

1. point number

2. feature code

3. X-coordinate

4. Y-coordinate

5. COMMENT (attribute)

Add a new converter (File/Formats/Vector file) with function Text and give format definition in Other-dialog: T3 T4 X Y COMMENT (use space as separator).

3. Comma separated data

Reading just like above, but every line must have same number of fields.

Example:

98,312,97193.356,44322.792
99,0,97193.356,44322.792,ISO
100,10,97193.356,44322.792

field content

1. point number

2. feature code

3. X-coordinate

4. Y-coordinate

5. COMMENT (attribute)

Add a new converter (File/Formats/Vector file) with function Text give format definition in Other-dialog: T3,T4,X,Y,COMMENT (use comma as separator). If any field is missing a value, it will remain empty (coordinates get 0.0).