You are here: Learn about... > Format of .csv files
GEOVIA GEMS

Format of .csv files

A comma-separated value (.csv) file is a text file containing a series of lines comprised of header and data rows.

The Block Model Converter can open and save block model data from .csv files, such as those used by Microsoft Excel and Microsoft Access. Although .csv files use a common syntax, the Block Model Converter converts the block model data into a specific format. The data must also be in this particular format when opening .csv files that contain block model data.

ClosedExample of a .csv file as used by the Block Model Converter

Header rows

The first six rows of the .csv file are the header rows. They follow a specific structure.

Row 1: Column headings

The first row contains a set of comma-separated values, each of which provides the heading for the data in the second row.

Note: These values are displayed as two lines in this help topic only. In a .csv file, they are on a single line.

csv_version,lower_x,lower_y,lower_z,upper_x,upper_y,upper_z,rot_origin_x,rot_origin_y,rot_origin_z,rotation_x,rotation_y,rotation_z,
user_block_size_x,user_block_size_y,user_block_size_z

These columns define the version of the .csv file format output by the Block Model Converter and the following information about the originating block model:

  • lower coordinates
  • upper coordinates
  • point of rotation
  • rotation (XYZ clockwise rotations in degrees)
  • user block size

Row 2: Values

The second row contains the values of each item defined in the first row of the file. These values are all doubles.

Row 3: Column headings

This third row contains a set of comma-separated values, each of which provide the heading for the data in that column. The first seven columns are pre-defined by the Block Model Converter and are always in this format:

X,Y,Z,size(X), size(Y), size(Z),volume

These column headings define the coordinates of the block centroids, dimensions of the blocks, and volume of the blocks. These values are all doubles.

The remainder of the first row contains a set of user-defined block attribute names - one for each distinct attribute in the block model data. Each attribute name must be unique within the block model. There is no restriction on the number of additional columns that can be defined in this set, but the total number of columns in the first row should be consistent with those in all of the remaining rows in the file.

Row 4: Descriptions of attributes

The fourth row contains a description of each attribute defined in the third row of the file.

These descriptions are optional, but the first value must be Variable descriptions: and for the subsequent six columns, and any additional attribute that has no description, a comma separator with no value must be provided.

Row 5: Types of attributes

The fifth row contains the type definition for each attribute defined in the third row of the file.

The first value must be Variable types:. For the subsequent six columns, a comma separator with no value must be provided. For any additional attributes, one of the following types must be specified:

  • string: text string value
  • name: byte value that indexes into a comma-separated list of names provided in the default value for the attribute
  • byte: 8-bit integer value
  • short: 16-bit integer value
  • integer: 32-bit integer value
  • long: 64-bit integer value
  • float: 32-bit floating point value
  • double: 64-bit floating point value
  • calculated: no value (the description of the attribute provides a formula to be used in calculating the attribute value)

Row 6: Default values of attributes

This sixth row contains an optional default value for each attribute defined in the third row of the file.

The first value should be Variable defaults:. For the next six columns, and for any attribute that has no default value, a comma separator with no value must be provided.

Data Rows

The remainder of the file consists of rows of block data, each following the format defined by the header rows. The block coordinates, dimensions, and volume make up the seven comma-separated values. Then they are followed by a comma-separated value for each of the attributes of the block.