Skip to main content

Generate Table From Text

AutomatR.DefaultActivities.Datatable.GenerateTableFromText

The "Generate Table From Text" activity in AutomatR allows you to create a DataTable from the content of a specified text file. This activity is particularly useful when you need to extract tabular data from a text file and work with it in your workflows.

Properties

NameDescription
Input
File Path/TextSpecifies the full path of the text file on the local drive or the actual text from which you want to generate a DataTable. String variables containing the file path or text.
Has HeadersIndicates whether the first row of the text file contains headers. If enabled, the first row is considered as headers in the resulting DataTable. Boolean variables containing the information.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Generate Table From Text" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.
DelimiterSpecifies the delimiter in the text file to separate columns (e.g., Tab, Comma(,), Semicolon(;), Caret(^), or Pipe(I)). String variables containing the delimiter information.
Output
ResultOutputs the DataTable with data extracted from the specified inputs. Variables of type DataTable to store the generated table.

How to use:

  1. Drag and drop the "Generate Table From Text" activity onto the workflow.
  2. Configure the properties by specifying the file path or text, indicating whether the text has headers, and setting optional parameters such as delay and delimiter.
  3. Execute the workflow to generate a DataTable from the specified text file or text.

Example: Consider an example where the "Generate Table From Text" activity is used to create a DataTable from a text file:

Generate Table From Text:
File Path/Text: "C:\data\sample.txt"
Has Headers: True
Delimiter: ","
Result: dataTableResult

In this example, the activity reads the content of the "sample.txt" file, considering the first row as headers, using a comma as the delimiter. The resulting DataTable is stored in the variable "dataTableResult" for further use in the workflow.