Skip to content

File Configuration Options

K J D S SRINIVASA RAO edited this page Mar 11, 2020 · 11 revisions

File Configuration Options

The below options are available to configure and generate a flat file:

  • FileName : Name of the flat file which will be appended with time stamp (format : yyyyMMddHHmmssffff) to make it unique every time it is run. Files will be generated in a directory named "files". Generated filename will be similar to 202001131015059362_test.csv
  • Separator : The separator to be used while generating the file. This is optional in case of files with types .csv and .tsv
  • ShowRowNumber : When set to true this will add a new column at the beginning of the flat file named "rowNumber" and shows the row number. By default this is false. This is optional.
  • Rows : The number of rows the flat file must contain. This is a mandatory field
  • Columns : This is an array of columns with specified types and respective column configurations. Detailed information on how to configure columns can be found here

Typical configuration file

{
  "fileName": "test.csv",
  "showRowNumber": true,
  "seperator": ",",
  "rows": 1000,
  "columns": [
    {
      "name": "Row id",
      "type": "guid"
    },
    {
      "name": "Created On",
      "type": "date",
      "config": {
        "format": "dd-MM-yyyy"
      }
    },
    {
      "name": "Today date",
      "type": "default",
      "config": {
        "defaultValue": "kjds"
      }
    },
    {
      "name": "First Name",
      "type": "string",
      "config": {
        "prefix": "KJDS"
      }
    },
    {
      "name": "Last Name",
      "type": "string",
      "config": {
        "length": "2|5"
      }
    },
    {
      "name": "SortCode",
      "type": "int"
    },
    {
      "name": "Email",
      "type": "email"
    },
    {
      "name": "Amount",
      "type": "decimal",
      "config": {
        "decimalPart": 4
      }
    },
    {
      "name": "IsValid",
      "type": "bool"
    },
    {
      "name": "CustomValues",
      "type": "list",
      "config": {
        "items": [
          "kjds",
          1,
          "bool",
          "any"
        ]
      }
    }
  ]
}


Clone this wiki locally