You are here: Menu Commands > File > Import > Data from one file
GEOVIA Surpac

Import data from one file

Often it is desirable to be able to use data from other sources. This function allows such `foreign' files of coordinate data to be reformatted into standard string files which can be directly used by all modules.

To run this function: Choose File > Import > Data from one file, or...

  • In the Function Chooser, type IMPORT FROM TEXT, and press ENTER.

Files to be reformatted are basically of two types.

  • Fixed format files - in which each coordinate or description value occupies fixed character positions within each record.
  • Delimited field files - in which the individual coordinate or description values in the file are delimited by a special character, such as a comma, spaces, or tab characters.

Often foreign files contain only some coordinates. This module will supply a string number and a value of 0.0 for coordinates not represented in the file. These may then be further edited using other string editing utilities.

Foreign files may also comprise a variable number of header lines. The option is given to specify how many lines of the input file are to be skipped before reading coordinate records.

Reformatting Co-ordinate Files

The files to be processed and produced are defined as follows.

Text file name

The input file may have any name and may be selected by using the file browser.

Output to string file

Location, ID and String No.

Enter or select the Location and Id of the string file to be created. You may also nominate the string number for the imported coordinates.

Number of header lines

Enter the number of lines to be skipped at the beginning of the input file.

Number of description fields

Enter the number of description values to be read from each record of the input file.

Delimited?

Specify whether fields in the input file records are delimited by a character or occupy fixed columns.

Delimiter

If you selected Y for the above, specify the character that separates the fields. You may leave this field blank if input fields are delimited by white space (blanks or tabs).

Log file name

Select or specify a file (which will be given a .log extension) for storing records that could not be successfully converted to a point using the field position information given. This file will only be created if such errors occur. Leave blank if you do not wish to generate a log file. Complete the IMPORT FROM TEXT FILE form and choose Apply to display one of the FIELDS forms (depending on whether the input records are delimited or not).

Define fields for delimited file

Field No.

Specify the position of the field for the nominated coordinate or description value. If the position for any of the coordinate values is specified as 0 or left blank, then a default value of 0.0 will be used as the value for that coordinate in the resulting string file.

Define fields for fixed format file

For each of the required fields, enter the starting and ending column numbers to define the position of the fields in the input file (`foreign file').

This is best done by first using a text editor to look at the `foreign file' and note down the start and end columns for each field, before selecting this function.

Field From

Specify the starting column for the nominated coordinate or description value. If this is specified as 0 or left blank for any of the coordinate values then a default value of 0.0 will be used as the value of that coordinate in the resulting string file.

Field To

Specify the ending column for the nominated coordinate or description value. Note that if the Field To value is less than the Field From value the form will not be accepted and a message to that effect indicating the problem description field will be given.

Result

This function will create a string file comprising a string of the specified number with points as read from the coordinate and description values in the input records. If errors were encountered and an error log file was specified, the log file will list the line number and contents of offending records.