fdcfd1b5 8a1e 2e42 7c69 47a11d42b766 - akesseler/Plexdata.CsvParser GitHub Wiki

CsvWriter.Write Method (CsvContainer, String, CsvSettings, Boolean)

This method tries to write given container into given file.

Namespace: Plexdata.CsvParser.Processors
Assembly: Plexdata.CsvParser.NET (in Plexdata.CsvParser.NET.dll) Version: 1.1.3+d5bef99aa35461ce4bafadf0bf2c2aeca18044ea

Syntax

C#

public static void Write(
	CsvContainer container,
	string filename,
	CsvSettings settings,
	bool overwrite
)

Parameters

 

container
Type: Plexdata.CsvParser.Processors.CsvContainer
The container to be written to the CSV file.
filename
Type: System.String
The fully qualified path of the output file.
settings
Type: Plexdata.CsvParser.Processors.CsvSettings
The settings to be used to generate the output of the CSV file.
overwrite
Type: System.Boolean
If true, then a possible existing file is overwritten. Otherwise, an exception is thrown if a file with the same name already exists.

Exceptions

 

Exception Condition
ArgumentException This exception is thrown either in case of given values are invalid or if given filename is invalid.
InvalidOperationException This exception is thrown if overwrite mode is disabled and given file already exists or in case of given file could not be deleted. Another reason could be the case when property parsing fails.
ArgumentNullException This exception is thrown if given container is .

Remarks

This method determines the file existence and performs file deletion if requested. Thereafter, the file content is handled by creating and processing a stream.

See Also

Reference

CsvWriter Class
Write Overload
Plexdata.CsvParser.Processors Namespace

⚠️ **GitHub.com Fallback** ⚠️