diff --git a/code/LumenWorks.Framework.IO/Csv/CsvReader.cs b/code/LumenWorks.Framework.IO/Csv/CsvReader.cs index bbe8ff9..1d2ac9e 100644 --- a/code/LumenWorks.Framework.IO/Csv/CsvReader.cs +++ b/code/LumenWorks.Framework.IO/Csv/CsvReader.cs @@ -1418,9 +1418,12 @@ public bool ReadNextRecord() /// Indicates if the reader will skip directly to the next line without parsing the current one. /// To be used when an error occurs. /// + /// + /// Indicates if the reader should be case-sensitive when parsing headers. + /// /// if a record has been successfully reads; otherwise, . /// The instance has been disposed of. - protected virtual bool ReadNextRecord(bool onlyReadHeaders, bool skipToNextLine) + protected virtual bool ReadNextRecord(bool onlyReadHeaders, bool skipToNextLine, bool caseSensitiveHeaders = false) { if (_eof) { @@ -1488,7 +1491,8 @@ protected virtual bool ReadNextRecord(bool onlyReadHeaders, bool skipToNextLine) Array.Resize(ref _fields, _fieldCount); } - _fieldHeaderIndexes = new Dictionary(_fieldCount, StringComparer.CurrentCultureIgnoreCase); + var headerComparer = caseSensitiveHeaders ? StringComparer.CurrentCulture : StringComparer.CurrentCultureIgnoreCase; + _fieldHeaderIndexes = new Dictionary(_fieldCount, headerComparer); _initialized = true;