file_skip_words

Synopsis

file_skip_words (file, offset, nwords)

Description

The file_skip_words object returns the offset in bytes of a location after skipping nwords in an ASCII file . The words must be separated by spaces.

Parameters

file

Object of type FILE.file that identifies the file that will be accessed. Note that this is not a string holding the filename. See the example.

offset

int. Specifies, in bytes, an offset from the beginning of the file.

nwords

int. number of words to skip

Example

To read the third integer on line 10 in the ASCII file, data :

file data_file {
name = "data";
};


/* skips 9 lines */
int line_offset=> file_skip_lines (data_file, 0, 9);
int offset => file_skip_words(data_file, line_offset, 2);
int value => file_scalar_ascii(file_file , offset, 3)

Additional Examples

v/dv_examp/file_ucd.v
v/dv_examp/file_unif.v

File

v/file.v

See also related modules

File Objects Overview
file_array_ascii
file_find_expr
file_obj
file_obj bin
file_scalar_ascii
file_skip_lines
file_skip_words