Readtextfile

Reads a text file.

Member of namespace

FileIO

Syntax

bool ReadTextFile (string filename, string target)

Parameters

  • filename - The name and path of the text file to read.
  • target - The DCO node to store the value of the text file.

Smart parameters are supported for each parameter.

Returns

True if the text file exists and was successfully read, otherwise False.

Level

All levels.

Details

Reads the specified file and stores the entire contents of the file in a DCO variable. Depending on the file, this could potentially require a significant amount of memory and when running, Datacap will retain the all of the DCO objects and all of their variables in memory.
Example:
ReadTextFile("C:\Temp\ReadThis.txt","@P.text")

The above example reads the specific file and saves the value on the page object in a variable named "text"

ReadFile("C:\Temp\ReadThis.xml","@P\xmltext")

The above example reads the specific file and saves the value on the page object in a variable named 'xmltext'.