forked from JoshClose/CsvHelper
-
Notifications
You must be signed in to change notification settings - Fork 1
Custom Configurations
JoshClose edited this page Feb 15, 2013
·
4 revisions
Let's say you want to use a ; instead of a comma:
FileStream f = new FileStream(filePath, FileMode.Open);
StreamReader streamReader = new StreamReader(f);
/* A new configuration instance that you can change at will */
CsvConfiguration config = new CsvConfiguration();
config.Delimiter = ';';
/* Give it to your CsvReader */
CsvReader csvReader = new CsvReader(streamReader, config);- QuoteAllFields - {boolean} - Set if all fields get wrapped in quotes or just the mandatory ones.
- QuoteNoFields - {boolean} - Set to enforce no fields get quoted.
- HasHeaderRecord - {boolean} - CSV file shall have a header record, default is true
- IsStrictMode - {boolean} - Enable strict reading, if an error occurs will throw exception.
- Delimiter - {string} - Set a field delimiter, default is ","
- Quote - {string} - Character to use for quoted fields, default is '"'
- AllowComments - {boolean} - Allow comment out lines
- BufferSize - {int} - Size of buffer for reading/writing csv, default is 2048