CsvExtractor

Extracts data from a CSV.

Arguments

Argument Mandatory Type Default value Description Example
filename Yes string Name of the file to extract data from
columns Yes special See Columns
separator No string , Columns separator
enclosure No string " Values enclosure
escape No string \ Escape character
skiprows No integer 0 How much rows to skip

Example jobfile

<?xml version="1.0" ?>
<job name="CsvExtractorExample">
    <extractor>
        <class>BiSight\Etl\Extractor\CsvExtractor</class>
        <argument name="filename">{{filename}}</argument>
        <argument name="columns">invoice_number:integer,created_at:datetime,description,client:string(64),total:decimal,payed_at:datetime</argument>
        <argument name="separator">,</argument>
        <argument name="enclosure">"</argument>
        <argument name="escape">\</argument>
        <argument name="skiprows">1</argument>
    </extractor>
    ...
</job>

Try this

To see CsvExtractor in action - just run:

bin/try extractor csv