Logo of php-etl
Getting Started
🐘 Standalone 🎵 Symfony 🦢 Sylius
Core Concepts
The Concept Execution Context Item Types Custom Operations Glossary FAQ
⛓️ Operations
Building Blocks
Split Merge Repeat Safe
Extract
File Finder CSV JSON
Transform
External File Processor Filter Data Rule Transformer Split Item HTTP Client Log Callback
Aggregation
Simple Grouping
Load
CSV JSON
🧑‍🍳 Cookbook
Without Context
Grouping / Aggregation Filtering Splitting/Forking Making your chains configurable Complex data to csv / Flatten Data Api to CSV N°1 Api to CSV N°2 Sub chains
With Context
Api to CSV Import external file
Custom Operations

PHP-ETL - Operations
Extract- CSV File(csv-read)

The csv-read operation reads a CSV file, outputting a GroupedItem with an iterator for row-by-row processing. It typically follows an operation providing a file path, like file-finder.

The operation receives a DataItem that contains the path to the csv file to read. It will return a list DataItem’s. Should e used after a external file processor operation.

Options

  • delimiter: (Optional) Character separating fields. Defaults to ;.
  • enclosure: (Optional) Character enclosing fields. Defaults to ".
  • escape: (Optional) Character escaping special characters. Defaults to \.
  • file_key: (Optional) If input is an array, the key (e.g., key/subkey) containing the CSV file path.

Example

chain:
  - operation: file-finder
    options:
      path: /path/to/input.csv

  - operation: csv-read
    options:
      delimiter: ","

  - operation: rule-transformer
    options:
      # Rules to transform the CSV data.

  - operation: load-csv
    options:
      path: /path/to/output.csv

Network

GitHub Repo Issues Good First Issues

Help Preserve This Project

Support for the continued development of php ETL. I maintain this project in my free time.

Support
Free & Open Source (MIT)