bottom

File Extractions

User Rating: / 1
PoorBest 

FileGenPane

Purpose

The File Extraction reads text file and provides content as a sequence of strings. It is possible to split the content of the read file using constant length or a delimiter.

This generator traverses the underlying file from its beginning until the end of file. When the end of file is reached, the generator becomes exhausted and the whole generation stops.

If you want to loop over the file and restart from the beginning when the end of file is reached you can use a Loopback rule in front of the file extraction rule.

Usage

The basic usage of this rule is to retrieve reference data to enforce the realism of generated data. It is often implemented in conjunction with other rules as front end such as Loopback, Sampler, Filter and CSV Extraction to retrieve the appropriate subset data from the traversed files.

For example, consider you have a CSV file for which you want only the second and third columns if the first matches a given regular expression. Then you can use a Filter (configured with the regular expression applied to the first column of extracted records) and a CSV Extraction to provide only the second and third columns on the filtered records.

Configuration

The file to be traversed by the generator should be part of your own workspace, or the shared library, in the Output or Data spaces. All available input data files are listed in the combo of the File parameter.

With the Delimiter Type parameter you can configure the rule to tell the generator to split every n characters or as soon as a delimiter string is found in from the file's input stream.

With the Include Delimiter parameter, and when a string delimiter string is specified (for example \n for newlines) it is possible to tell the generator to keep or throw away those delimiters.

See also...

If you want to loop back at the beginning of the file when the end is reached, you can use a Loopback rule as a front end to your file extraction rule.

If you want to extract data at random positions from the underlying file you can use a Sampler rule as a front end to your file extraction rule.

Add comment


Security code
Refresh