composer.json
{ "name": "flow-php/examples", "description": "Flow PHP - Examples", "license": "MIT", "type": "library", "require": { "flow-php/etl": "1.x-dev", "flow-php/etl-adapter-csv": "1.x-dev" } }
code.php
<?php declare(strict_types=1); use function Flow\ETL\Adapter\CSV\from_csv; use function Flow\ETL\DSL\{data_frame, lit, ref, to_stream}; require __DIR__ . '/vendor/autoload.php'; data_frame() ->read(from_csv(__DIR__ . '/input/color=*/sku=*/*.csv')) ->filterPartitions(ref('color')->notEquals(lit('green'))) ->collect() ->write(to_stream(__DIR__ . '/output.txt', truncate: false)) ->run();
+----+-------+-----------+ | id | color | sku | +----+-------+-----------+ | 7 | blue | PRODUCT01 | | 8 | blue | PRODUCT02 | | 1 | red | PRODUCT01 | | 2 | red | PRODUCT02 | | 3 | red | PRODUCT03 | +----+-------+-----------+ 5 rows