Skip to content

File Configuration Options

K J D S SRINIVASA RAO edited this page Jan 22, 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.
  • ShowRowNumber : When set to true this will add a new column at the beginning of the CSV named "rowNumber" and shows the row number. By default this is false.
  • Rows : The number of rows the flat file must contain.
  • 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": "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"
    },
    {
      "name": "SortCode",
      "type": "int"
    },
    {
      "name": "Email",
      "type": "email"
    },
    {
      "name": "Amount",
      "type": "float"
    },
    {
      "name": "IsValid",
      "type": "bool"
    }
  ]
}


Clone this wiki locally