CsvSaveOptions
OfficeIMO.CSV
Options controlling how CSV content is serialized.
Inheritance
- object
- CsvSaveOptions
Usage
Explore 14 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 2
- Method CsvProfiles.CreateSaveOptions
- Method CsvSaveOptions.Clone
Accepted by parameters 12
- Method CsvDocument.Save
- Method CsvDocument.SaveAsync
- Method CsvDocument.SaveObjects
- Method CsvDocument.ToBytes
- Method CsvDocument.ToString
- Method CsvDocument.WriteDataReader
- Method CsvDocument.WriteDataReaderParallel
- Method CsvDocument.WriteDataTable
- Method CsvDocument.WriteObjects
- Constructor CsvRowWriter.CsvRowWriter
- Method CsvRowWriter.CreateFile
- Method CsvRowWriter.CreateStream
Constructors
public CsvSaveOptions() #Methods
public CsvSaveOptions Clone() #Creates an independent copy of these save options.
Returns
CsvSaveOptionsInherited Methods
Properties
public char Delimiter { get; set; } #Gets or sets the field delimiter character. Default is ,.
public string? DelimiterText { get; set; } #Gets or sets the field delimiter text. Leave unset to use CsvSaveOptions.Delimiter. Single-character values keep the optimized character delimiter path; longer values enable flexible delimiter writing.
public string NewLine { get; set; } #Gets or sets the newline sequence written between records. Default is Environment.NewLine.
public bool IncludeHeader { get; set; } #Gets or sets whether to include the header row when writing. Default is true.
public CultureInfo Culture { get; set; } #Gets or sets the culture used for formatting values. Defaults to CultureInfo.InvariantCulture.
public Encoding? Encoding { get; set; } #Gets or sets the text encoding used when writing to files or streams. Defaults to UTF-8 without BOM when omitted.
public CsvCompressionType CompressionType { get; set; } #Gets or sets compression used when writing files. Default infers compression from the file extension.
public CompressionLevel CompressionLevel { get; set; } #Gets or sets the compression level used when writing compressed CSV files.
public string? NullValue { get; set; } #Gets or sets the token written for null values. Defaults to an empty field.
public string? DateTimeFormat { get; set; } #Gets or sets a custom date/time format used when writing DateTime and DateTimeOffset values.
public bool UseUtc { get; set; } #Gets or sets whether date/time values are converted to UTC before formatting.
public bool Append { get; set; } #Gets or sets whether file output appends to an existing CSV file.
public bool NoClobber { get; set; } #Gets or sets whether file output should fail if the destination already exists.
public CsvFormulaInjectionPolicy FormulaInjectionPolicy { get; set; } #Gets or sets how formula-like values are handled before writing CSV output. Default preserves values exactly.
public CsvQuoteMode QuoteMode { get; set; } #Gets or sets when fields are quoted. Default quotes only fields that need quoting.
public CsvEscapeMode EscapeMode { get; set; } #Gets or sets escape encoding for fields. Default is CsvEscapeMode.None. CsvEscapeMode.Backslash requires CsvSaveOptions.QuoteMode to be CsvQuoteMode.Never.
public string[]? QuoteFields { get; set; } #Gets or sets field names that should always be quoted when CsvSaveOptions.QuoteMode is CsvQuoteMode.AsNeeded.