CsvFileInputRecordStream.ReadRecordTo
- Updated2025-07-21
- 2 minute(s) read
CsvFileInputRecordStream.ReadRecordTo
Syntax
CsvFileInputRecordStream.ReadRecordTo( context, record)
Return Value
Returns 0 if a record was successfully read. Returns -1 if end of file was encountered before reading a record. Returns 1 if the end of a table was encountered before reading a record.
Purpose
Read the next record from this stream. Implements InputRecordStream.ReadRecordTo .
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.ReadRecordTo 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.
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.ReadRecordTo 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
context As SequenceContext
[In] Specifies the SequenceContext against which to evaluate the lookup strings specified by the record parameter. Refer to InputRecordStream.ReadRecordTo for more information.
record As String Array
[In/Out] An array of lookup strings specifying where to store the fields from the incoming record. The lookup strings are evaluated relative to the SequenceContext specified by the context parameter. Refer to InputRecordStream.ReadRecordTo for more information.