ILNumerics Ultimate VS

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

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

[ILNumerics Computing Engine]

Namespace:  ILNumerics
Assembly:  ILNumerics.Computing (in ILNumerics.Computing.dll) Version: 5.4.0.0 (5.4.7431.3055)
Syntax

public static void csvwrite<T>(
	InArray<T> A,
	Stream stream,
	Func<T, string> elementConverter = null,
	string elementSeparator = ",",
	CultureInfo culture = null,
	Encoding encoding = null,
	bool leaveStreamOpen = false
)

Parameters

A
Type: ILNumericsInArrayT
ILNumerics array to write as CSV. This is expected to be a matrix.
stream
Type: System.IOStream
Stream 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 stream.
leaveStreamOpen (Optional)
Type: SystemBoolean
[Optional] If set to true stream will not be closed by this method. Default: false.

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