CsvFileOutputRecordStream.WriteFieldHeaders
- Aktualisiert2025-07-21
- 1 Minute(n) Lesezeit
CsvFileOutputRecordStream.WriteFieldHeaders
Syntax
CsvFileOutputRecordStream.WriteFieldHeaders( fields, mapping = "")
Purpose
Write the field headers (i.e. column names) for your data to the underlying CSV file.
Remarks
WriteFieldHeaders is very similar to CsvFileOutputRecordStream.WriteRecord . The only difference is that if the specified record is a container, the names of the subproperties are written to the CSV file instead of the values. This makes it straightforward to completely specify records with a container. WriteFieldHeaders will also accept an array, but in this case the behavior is identical to CsvFileOutputRecordStream.WriteRecord . The values in the array specify the field headers.
Parameters
fields As PropertyObject
[In] A container or array specifying the field headers. If a container is specified, names of the subproperties specify the field headers. If an array is specified, the values of the array elements coerced to strings define the field headers.
mapping As String
[In] Specifies the mapping from elements (either subproperties or array elements) in the fields parameter to fields in the stream. The mapping is a comma-separated list of index ranges. For example, " 0, 3-5, 8-7 " specifies that elements 0, 3, 4, 5, 8, and 7 define the field headers. The final range in the list may be open-ended. For example, " 2, 3- " indicates that elements 2, 3, and all elements beyond 3 define the field headers. For convenience, you may specify an empty string to specify all elements be written in order. That is, an empty string is equivalent to 0- . The default value is an empty string.
This parameter has a default value of "" .