Home Search

DriveWorks Pro 22
Import Lines From a Text File into Constants and Controls

Send Feedback

Import Lines From a Text File into Constants and Controls

This Specification Flow Task reads in multiline, two column data from a text file, and passes them into the specification for driving into constants or controls.

Import Lines From a Text File into Constants and Controls Properties

Property NameDescription
TitleChanges the Title (not the name) of the task.
File NameFull Path and File Name of the txt or csv file - Including Extension.
Constant NameThe constant used to report on the success of the specification task, for reference only.
DelimiterCharacter that is used between the values on each row (comma by default).

Example Data

The text file used for the import is to have two columns:

  • The first column contains the name of the constant or control (do not include the DWConstant prefix or the Return suffix).
  • The second column contains the value to be passed into the constant or control.

If a constant is found with the same name (Not case sensitive) then the value from the second column will be passed into it.

If no constant is found with that name, then DriveWorks will look for a form control with that name to pass the value to.

If no control is found, then no action will be taken with that rows data.

If a constant and control exist with the same name the constant will take priority.

The text file needs headers in the first row, which need to be in the format:

NameValue
OverallLength485
ClevisOptionUniversal Clevis
TotalPrice$253.75

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

  • Data imported successfully.

Success with Warnings

  • N/A - should never be fulfilled.

Failed (one of the following occurred)

  • Error while importing data.
  • File Name does not exist.
  • File Name cannot be empty.
  • File extension not valid.
  • General failure - Check the Specification report for more details.