b37962bf e8b8 c6ef abef 54ba079a1ea3 - akesseler/Plexdata.CsvParser GitHub Wiki

CsvExporter(TInstance).Save Method (IEnumerable(TInstance), String, CsvSettings, Boolean)

This method tries to save given values 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 Save(
	IEnumerable<TInstance> values,
	string filename,
	CsvSettings settings,
	bool overwrite
)

Parameters

 

values
Type: System.Collections.Generic.IEnumerable(TInstance)
The list of values 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.
NotSupportedException This exception is thrown in case of confirming and ordering the column offsets fails.

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

CsvExporter(TInstance) Class
Save Overload
Plexdata.CsvParser.Processors Namespace

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