DriveWorks Pro 17: Export A Table Array To A Text File [send feedback...]

Export A Table Array To A Text File

This Specification Flow Task exports a Table Array to an existing text file.

This Task will create a text file if the target file name does not exist.

Properties

Property NameDescription
TitleChanges the Title (not the name) of the task.
Target File NameFile name of the target text file (Full path plus extension).
Array ValueA Table array value, such as the result of a QueryDataValues function.
Include HeaderTRUE to include first row, FALSE to exclude.
OverwriteTRUE to overwrite the file if it exists.

Example

When this Task is added the properties are static. To be able to build rules on a static property see How To: Change A Static Property To A Dynamic Property.

Property NameExample RuleExample ResultMeaning
Target File Name"C:\MyDocuemnts\Exports\ArrayText.txt"C:\MyDocuemnts\Exports\ArrayText.txtThis is the Target location of the text file that is to be written to.
Array ValueDWVariableTableArrayDWVariableTableArrayThis is a Variable where the Array value to use is stored
Include HeaderTRUETRUETRUE will include the headers when exporting the Array into a text file.
OverwriteTRUETRUETRUE will overwrite the file if it exists.

Example Data

Array
{"Id","FirstName","SecondName","Age";"1","Dave","Smith","34";"2","John","McClane","56";"3","Matt","Jackson","27";
"4","Rob","Holding","23";"5","Dan","Davis","30";"6","Sam","Jones","42"}

Example Text File

Created Text File

Id,FirstName,SecondName,Age

1,Dave,Smith,34

2,John,McClane,56

3,Matt,Jackson,27

4,Rob,Holding,23

5,Dan,Davis,30

6,Sam,Jones,42

Using the Task in a Specification Macro

This task has different types of Outputs. For more information about Outputs see Specification Macros Task Node.

Outputs are only available within Specification Macros. Currently Outputs are not available for Specification Flow.

Status Outputs

This task supports Status Outputs. These can be used to perform different actions depending on what the status outcome of the task is. For more information see Status Outputs in the Task Node Outputs section of Specification Macros Task Node.

The status output navigation is as follows:

Success

  • Array Value has been successfully written to the text file.

Success with Warnings

  • File already exists while Overwrite property is set to false.

Failed (one of the following occurred)

  • Target File Name cannot be left empty.
  • Invalid file extension.
  • Data to export is not in a table array format.
  • General failure - Check the Specification report for more details.

Table of Contents