Show / Hide Table of Contents

Class CsvWriterOptions

A class that represents the CsvOptions used by a CsvWriter.

Inheritance
Object
CsvOptions
CsvWriterOptions
Inherited Members
CsvOptions.DefaultDelimiter
CsvOptions.DefaultQuote
CsvOptions.DefaultComment
CsvOptions.Comment
CsvOptions.Delimiter
CsvOptions.TextQualifier
CsvOptions.UseTextQualifier
CsvOptions.RecordDelimiter
CsvOptions.RecordDelimiterHeader
CsvOptions.AlwaysUseNewLineAfterRecordDelimiter
CsvOptions.UseCustomRecordDelimiter
System.Object.ToString()
Object.Equals(Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
Object.MemberwiseClone()
Namespace: IRM.Data
Assembly: IRM.dll
Syntax
public class CsvWriterOptions : CsvOptions

Constructors

CsvWriterOptions()

Initializes a new instance of the CsvWriterOptions class.

Declaration
public CsvWriterOptions()

Properties

EscapeMode

Specifies how to escape an occurance of system characters, like the TextQualifier and Delimiter, inside field values when required. Default is EscapeMode.Doubled.

Declaration
public EscapeMode EscapeMode { get; set; }
Property Value
EscapeMode

Remarks

When the EscapeMode is set to EscapeMode.Doubled, occurances of the system character will be expected to be escaped by replacing it with two consecutive occurances of the TextQualifier. This is the format generally used for CSV in applications such as Excel.

When the EscapeMode is set to EscapeMode.Backslash, occurances of the system character will be expected to be escaped by preceding it with a backslash character. This format is common in Unix type environments.

When the EscapeMode is set to EscapeMode.Replace, occurrances of the system character will be replaced by the SystemCharacterReplacement

ForceQualifier

Use this to force all fields to be surrounded by the text qualifier even if the qualifier is not necessarily needed to escape this field. Default is false.

Declaration
public bool ForceQualifier { get; set; }
Property Value
Boolean

FormatDateUsingShortDatePattern

Set this property to true to format date fields with the ShortDatePattern.

Declaration
public bool FormatDateUsingShortDatePattern { get; set; }
Property Value
Boolean

Remarks

This settings only have effect it the System.Data.IDataRecord.GetDataTypeName(System.Int32) returns 'date'."

If this setting is set to true the property DefaultCultureInfo must also be set.

SemicolonSeperated

Gets a CsvWriterOptions with semicolon (;) as Delimiter.

Declaration
public static CsvWriterOptions SemicolonSeperated { get; }
Property Value
CsvWriterOptions

SystemCharacterReplacement

The character to be used as a replacement value for system characters inside field values then the EscapeMode is set to EscapeMode.Replace.

The default value is space.

Declaration
public char SystemCharacterReplacement { get; set; }
Property Value
Char

TabSeperated

Gets a CsvWriterOptions with Tab as Delimiter.

Declaration
public static CsvWriterOptions TabSeperated { get; }
Property Value
CsvWriterOptions

Extension Methods

ObjectExtensions.DeepClone<T>(T)
AnnotationsExtensions.IsValid(Object)
Back to top Generated by DocFX