Tasks
Parse Data File
Parses a data file into the stub data. The file has to be uploaded to Stubber using a file field or other means before it can be parsed. Only .csv
and .json
files can be parsed.
Basic usage
Parameters
required string
fileuuid The uuid of the file to be parsed.
required string
fieldname The data path to which the contents of the parsed file will be saved.
optional object
options Addional parsing options to pass to the parser.
CSV Options
- delimiter: The delimiter used in the CSV file. Default is
,
. - quote: The quote character used in the CSV file. Default is
"
. - trim: If set to
true
, the parser will trim whitespace from the values. Default istrue
. - ignoreEmpty: If set to
true
, the parser will ignore empty lines. Default isfalse
. - noheader: Indicating csv data has no header row and first row is data row. Default is
false
.
Properties
string
fieldname The data path to which the contents of the parsed file was saved.
Examples
Parse to a nested data path
Parses a file and saves the results in stub.data.results.json
.