Skip to content

File Configuration Options

K J D S SRINIVASA RAO edited this page Feb 18, 2022 · 11 revisions

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
  • FilePath : Directory where the flat file needs to be generated. This is optional and if not specified or specified as null, the file will be generated at default directory which is inside the files directory in the package.
  • 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",
  "filePath":  null,
  "showRowNumber": true,
  "seperator": ",",
  "rows": 1,
  "columns": [
    {
      "name": "Row id",
      "type": "guid"
    },
    {
      "name": "Created On",
      "type": "date",
      "config": {
        "format": "dd-MM-yyyy",
        "minYear": 2000
      }
    },
    {
      "name": "Today date",
      "type": "default",
      "config": {
        "defaultValue": "kjds"
      }
    },
    {
      "name": "First Name",
      "type": "string",
      "config": {
        "prefix": "KJDS",
        "case": "title"
      }
    },
    {
      "name": "Last Name",
      "type": "string",
      "config": {
        "length": "2|5",
        "case": "sentence"
      }
    },
    {
      "name": "SortCode",
      "type": "int",
      "config": {
        "prefix": "TEST-",
        "suffix": "SERIES"
      }
    },
    {
      "name": "Account Number",
      "type": "int",
      "config": {
        "prefix": "SAS-",
        "increment": true,
        "min": 1000,
        "interval": 10
      }
    },
    {
      "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