file_scalar_ascii (file, offset, type)
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:
|
|
ASCII file, data, contains an integer and a float:
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);