Skip to content

Commit

Permalink
Add csv extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
leomarquine committed Sep 12, 2018
1 parent 8a141d7 commit dc14017
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/Extractors/Csv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# CSV Extractor

The csv extractor can be used to get data from comma separated files with or without a header row.

## Options

| Name | Type | Default | Description |
| ---- |----- | ------- | ----------- |
| columns | array | null | Columns that will be extracted. |
| delimiter | string | , | Field delimiter (one character only). |
| enclosure | string | | Field enclosure character (one character only). |


## Usage

Default options:
```php
$etl->extract('csv', 'path/to/file.csv');
```

Custom options:
```php
$options = [
'columns' => [
'id' => 1, // Index of the column in the csv file (The first column is 1).
'name' => 2
]
];

$etl->extract('csv', 'path/to/file.csv', $options);
```
1 change: 1 addition & 0 deletions docs/Extractors/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Extractors

* [Collection](Collection.md)
* [CSV](Csv.md)
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
* [Getting Started](GettingStarted.md)
* [Extractors](Extractors/README.md)
* [Collection](Extractors/Collection.md)
* [CSV](Extractors/Csv.md)

0 comments on commit dc14017

Please sign in to comment.