Class CsvWriterOptions
A class that represents the CsvOptions used by a CsvWriter.
Inherited Members
Namespace: IRM.Data
Assembly: IRM.dll
Syntax
public class CsvWriterOptions : CsvOptions
Constructors
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 SystemCharacterReplacementForceQualifier
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
|