Tip
To work safely and conveniently with the CsvOpts enum, use the
extension methods of the CsvOptsExtension class (see example).
[FlagsAttribute]
public enum CsvOpts
<FlagsAttribute>
Public Enumeration CsvOpts
[FlagsAttribute]
public enum class CsvOpts
[<FlagsAttribute>]
type CsvOpts
None | 0 | No flag is set. This creates a very lenient parser that rarely throws exceptions. |
ThrowOnTooMuchFields | 1 | If set, CsvReader throws an CsvFormatException if a data row contains more fields than the first data row. |
ThrowOnTooFewFields | 2 | If set, CsvReader throws a CsvFormatException if a data row contains fewer fields than the first data row. |
ThrowOnEmptyLines | 4 | If set, CsvReader throws an CsvFormatException if there are blank lines in the CSV file that are not part of a data field masked with quotes. |
ThrowOnTruncatedFiles | 8 | If set, CsvReader throws an CsvFormatException if a masked field at the end of the file is not properly closed. |
Default | 15 | Default setting. This is a combined value, that forces CsvReader to throw an CsvFormatException if the file to be read does not comply with the RFC 4180 standard. (Alternative column separators and newline characters are always tolerated.) |
CaseSensitiveKeys | 16 | If the flag is not set, the class CsvRecord interpretes the column names of the CSV file in a case-insensitive manner. This is the same behavior that DataColumnCollection shows. |
TrimColumns | 32 | If the flag is set, CsvReader will remove leading and trailing white space from all data tokens and the column names. That can damage data where the white space has a meaning. Only set the flag for reading non-standard CSV files, that introduce additional padding. |
DisableCaching | 64 | Set this flag to gain performance benefits when parsing large files. Note that if this flag is set, the results of the read operation cannot be cached: the CsvRecord instance provided by CsvReader will then always be the same. Only the values it contains will update with each iteration. |