ILNumerics Ultimate VS

ILMathcsvwriteT Method (InArrayT, String, FuncT, String, String, CultureInfo, Encoding)

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Write ILNumerics array as separated strings to file

[ILNumerics Computing Engine]

Namespace:  ILNumerics
Assembly:  ILNumerics.Computing (in ILNumerics.Computing.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax

public static void csvwrite<T>(
	InArray<T> A,
	string filename,
	Func<T, string> elementConverter = null,
	string elementSeparator = ",",
	CultureInfo culture = null,
	Encoding encoding = null
)

Parameters

A
Type: ILNumericsInArrayT
ILNumerics array to write as CSV. This is expected to be a matrix.
filename
Type: SystemString
Name of the file to write values to.
elementConverter (Optional)
Type: SystemFuncT, String
[optional] Custom function used to convert elements of A to string. Default: [T].ToString()
elementSeparator (Optional)
Type: SystemString
[optional] Character chain used to separate individual elements. Default: ',' (comma).
culture (Optional)
Type: System.GlobalizationCultureInfo
[optional] Number format info used to acquire formatting information for converting numbers to string. Default: invariant culture (not current thread culture!)
encoding (Optional)
Type: System.TextEncoding
[optional] Encoding used to write the string representation of individual elements to the bytes of the file.

Type Parameters

T
Element type of input array A
Remarks

A is expected to be a matrix. If A has more than 2 dimensions trailing dimensions will be joined to the second dimension. This corresponds to: A[":;:"].

The optional parameters elementConverter, elementSeparator and culture are used to control the format of the resulting CSV result.elementConverter is used to convert a single element of A into its string representation, using the current cultures number format or the CultureInfo provided by culture.

Individual elements will be separated in the CSV result by ',' (comma) or by the character chain provided by elementSeparator.

[ILNumerics Computing Engine]

See Also

Reference