Fixed-Width-Columns-Loader (fwc)

This loader parses data with fixed-width columns. Using this loader requires setting the width option.

Loader name: fwc
Input type: any text file
Output type: tabular data

Options

  • width: Number of characters per column. Required.

    Type: number

  • primaryKey: Optionally define which column to use as the primary key (i.e. independent variable). Defaults to using the columns defined in the file.

    Type: string

  • columns: Optionally manipulate columns. Defaults to using the columns defined in the file.

    Type: string[] or {[old: string]: string}

    If an array is given, then only the entries given in the array are included. If an object is given, then the columns are renamed. The keys correspond to the old column names, and the values are the new names.
    Example: {a: 'x'} renames the column 'a' to 'x' and leaves all other columns as-is.

  • headerLine: Optionally define a line to be the header line. Defaults to line 1.

    Type: number

  • dataLine: Optionally define on which line to begin reading data. Defaults to headerLine +1.

    Type: number

Example of resource definition in YAML-format:

name: optional_resource_name  # defaults to input
input: ./path/to/file         # obligatory
loader: fwc
options:
  width: 16                   # set column width to 16 characters. Required
  primaryKey: T               # set column T as independent variable
  headerLine: 2               # e.g.: if column names start on line 2
  dataLine: 4                 # e.g.: if data starts on line 4

  # Can be either an object *or* an array
  # If an object is specified, then renames columns
  columns:                   
    T: Temperature            # rename column T to Temperature
  # If an array is specified, then includes only the listed columns
  columns:
    - H2O                     # include column H2O as-is

results matching ""

    No results matching ""