PHP ETL
  • Introduction
  • Getting Started
  • Extractors
    • Collection
    • CSV
    • Fixed Width
    • JSON
    • Query
    • Table
    • XML
  • Transformers
    • Convert Case
    • JSON Decode
    • JSON Encode
    • Rename Columns
    • Trim
    • Unique Rows
  • Loaders
    • Insert
    • Insert/Update
  • Helpers
  • Running Processes
Powered by GitBook
On this page
  • Options
  • Columns (required)
  1. Extractors

Fixed Width

Extracts data from a text file with fields delimited by a fixed number of characters.

$etl->extract('fixed_width', 'path/to/file.txt', $options);

Options

Columns (required)

Columns that will be extracted.

Type

Default value

array

null

Associative array where the key is the name of the column and the value is an array containing the start position and the length of the column;

$options = ['columns' => [
    'id' => [0, 5], // Start position is 0 and length is 5.
    'name' => [5, 40], // Start position is 5 and length is 40.
]];
PreviousCSVNextJSON

Last updated 6 years ago