file_array_ascii(file, offset, type, columns)
The file_array_ascii object reads an ASCII array from file starting at the position specified by an offset in bytes. The integer type specifies type of data:
|
|
columns is an array of 1s and 0s that represents words in the lines of an ASCII file. It indicates whether or not to read the words.
file_array_ascii reads the number of words corresponding to the dimensionality of the referencing object. It reports an error if it finds the end of file before the target object is filled. The words must be separated by spaces.
ASCII file, data , contains three columns of float numbers starting from line 100. There are 200 lines containing the array.
You want to extract the second and third components of the array:
file data_file{
name = "data";
};
int offset => file_skip_lines (data_file, 0, 100);
float values[200][2] =>
file_array_ascii(data_file,offset, 4, {0, 1, 1});