file_scalar_ascii


Synopsis


file_scalar_ascii (file, offset, type)

Description

The file_scalar_ascii object reads ASCII scalar data from file starting at the position specified by an offset in bytes. The integer type specifies the type of data:

Value

 

Data type

 

0

Byte

1

Character

2

Short

3

Integer

4

Float

5

Double

 

Example

ASCII file, data, contains an integer and a float:

128 666.777

To get the integer and float values:


file data_file {
name = "data";
};


int i_value => file_scalar_ascii(data_file, 0, 3);
int f_offset => file_skip_words(data_file, 0, 1);
float f_value => file_scalar_ascii(data_file, f_offset, 4);