CsvFileInputRecordStream.SkipRecords

Syntax

CsvFileInputRecordStream.SkipRecords( numRecords)

Return Value

Long

Returns 0 if numRecords were successfully skipped. Returns - 1 if end of file was encountered before numRecords were skipped. Returns 1 if the end of a table was encountered before numRecords were skipped.

Purpose

Skip the specified number of records. Implements InputRecordStream.SkipRecords .

Remarks

CsvFileInputRecordStream is designed to work with CSV files that may contain multiple tables. Strictly speaking, such files are not compliant with RFC 4180, but many common spreadsheet applications support them regardless.

If CsvFileInputRecordStream.SkipRecords encounters an empty line or a line with nothing but separator characters, it returns 1 to indicate it has reached the end of the current table. CsvFileInputRecordStream.ReadRecordTo returns -1 to indicate it has reached the end of the underlying file.

Note CsvFileInputRecordStream considers only empty lines and lines that contain nothing but separators as end-of-table markers. Lines containing whitepaces are not interpreted as end of table. A record consisting of nothing but empty strings can be represented by surrounding the empty strings with quotes. Such a record is read normally and not interpreted as end of table.

Applications that only need to read the current table do not have to be aware of end-of-table vs end-of-file distinction, as InputRecordStream.SkipRecords defines end of file to be any non-zero return value. However, applications that are aware they are reading a CsvFileInputRecordStream can distinguish between having reached the end of the current table and the actual end of the file by checking if the return value is +1 or -1 .

Parameters

numRecords As Long

[In] The number of records to skip. Refer to InputRecordStream.SkipRecords for more information.

See Also

InputRecordStream.SkipRecords

CsvFileInputRecordStream.SkipLines