You are here: Menu Commands > File > Import > Data from many files (string)
GEOVIA Surpac

Import data from many files (string)

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. It also offers the facility to be able to interchange the X, Y, and Z coordinates within standard '.str' files.

To run this function: Choose File > Import > Data from many files (string), or...

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

Files to be reformatted are basically of two types.

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

Often foreign files contain only X and Y coordinates. This module will supply a string number and Z value in the resulting string file. These may then be further edited using other string editing utilities.

The numeric fields for the String Number the Y, X, or Z will handle non-numeric characters or ASCII symbols by replacing them with a zero (0). However control characters such as Tabs , line feeds or end of file markers may cause formatting errors or halt input.

If errors occur during import check your data with a reliable text editor (which does not hide any control characters) or ensure when transferring data from another platform or operating system that the files are properly reformatted.

You may specify up to 100 different description fields to be extracted from the incoming data.

Reformatting Co-ordinate Files

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

Define files to be converted

Location, ID range and Extension

The files to be reformatted must be named according to the standard Location and IDrange naming scheme. The file extension must be entered explicitly, including the `.', e.g. `.txt'.

Use descriptions

If the descriptor fields are to be formatted enter (Y)es otherwise (N)o. For example, if the `foreign file' has data associated with each co-ordinate, then entering `Y' will instruct the function that descriptor fields are to be created.

Define files to be created

Location

Enter a new Location for the string files to be created.

Fields separated by a character

Enter Y to specify that the fields in the incoming data are separated by a delimiting character, as in a string file or N if the files contain fixed format data.

Character separator

Type in the delimiter character, e.g. comma. Only required if `Y' to above prompt. If the files contain fixed format data this input is ignored.

Does file have header record

Does file have axis record

String files all begin with two special records, a header record and an axis record. See Chapter 3 Concepts. Answer these prompts according to whether the files being processed contain these records. Typically these will only be present if the files being reformatted are string files already. Specify if the file contains a header record and an axis record. If reformatting a non string file then enter `N' for header and axis records.

Number of description fields

Enter the number of separate descriptor fields. If you wish to treat the descriptor as a whole, enter 1 at this prompt. Otherwise it is possible to assign individual input field numbers to each descriptor field. Only required if `Y' answered to Use descriptions prompt outlined above.

Complete the IMPORT COORDINATES FROM TEXT FILES form and choose Apply to display the CONVERT TEXT FILES TO .STR FILES form for delimited field files.

Define the order of the fields

Enter the number of the field which contains the Y, X and Z values and the string number.

If you enter String number as field 0, then default string number 1 will be used in the output string file.

If you enter Z as field 0, then a default Z value of 0.0 will be used. The X and Y fields must be present.

Complete the CONVERT TEXT FILES TO .STR FILE form and choose Apply to display a second CONVERT TEXT FILES TO OBS FILES for FIELDS SEPARATED BY A CHARACTER form.

Define order of the description fields

Description sub field

For each of the description fields specified on the IMPORT COORDINATES FROM TEXT FILES form, the description field number to which the data are to be written must be entered.

Text file field number

For each of the description fields specified, the field number of the original data in the `foreign file' must be entered. Enter the field number in the input file which contains the appropriate Description field.

Reformatting Fixed Format Foreign Files

Complete the IMPORT COORDINATES FROM TEXT FILES form and choose Apply to display the CONVERT TEXT FILES TO .STR FILES for FIXED FORMAT FILES form.

Define the start and end columns
String number
Y value
X value
Z value

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.

If no string number is present enter the starting column as 0 and all points will be assigned to string 1. If no Z value is present enter the starting column as 0 and a Z value of 0.00 will be assigned to each point.

Complete the CONVERT TEXT FILES TO .STR FILES for FIXED FORMAT FILES form and choose Apply to display a second CONVERT TEXT FILES TO .STR FILES for FIXED FORMAT FILES form.

Description field number

Display only. The description field number currently being defined.

Start column

End column

Enter the starting and ending column numbers which contain the data for the required description field.

Result

This function will create one string file for each input file. The ID number for each string file will be the same as for the corresponding input file.