Skip to content

Commit

Permalink
more doc
Browse files Browse the repository at this point in the history
  • Loading branch information
fab2s committed Apr 23, 2018
1 parent e4777c7 commit 8096855
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/citizens.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ $lineExtractor->setUseBom(false);
foreach($lineExtractor as $line) {
// do something with trimed non empty $line
}

// or in a Flow
// (new YaEtl)->from($lineExtractor)-> ... // you get a line as record

// handle is released upon destruction, but you can do it earlier
$lineExtractor->releaseHandle();
```

### CsvExtractor
Expand Down Expand Up @@ -187,6 +193,12 @@ $csvExtractor->setHeader($header);
foreach($csvExtractor as $record) {
// do something with $record array
}

// or in a Flow
// (new YaEtl)->from($csvExtractor)-> ... // you get an array as record

// handle is released upon destruction, but you can do it earlier
$csvExtractor->releaseHandle();
```

### CallableExtractor
Expand Down Expand Up @@ -543,11 +555,18 @@ $csvLoader->setUseHeader(true);
// note that header field order is IMPORTANT
$csvLoader->setHeader(['title', 'first', 'last']);

// in case you whish to add the infamous sep=$this->delimiter
$csvLoader->setUseSep(true);

// or a BOM, provided that you set an unicode encoding
$csvLoader->setUseBom(true)->setEncoding('UTF-16LE');

// standalone
$csvLoader->load(['Mr', 'John', 'Doe']);

/*
* will write
\xFE\xFFsep=,
title,first,last
Mr,John,Doe
* To the output file
Expand All @@ -560,6 +579,12 @@ $csvLoader->load(['Mrs', 'Jane', 'Doe']);
Mrs,Jane,Doe
* To the output file
*/

// or in a Flow
// (new YaEtl)->from($soemExtractor)-> ... ->to($csvLoader)->exec();// take an array as record

// handle is released upon destruction, but you can do it earlier
$csvLoader->releaseHandle();
```


Expand Down

0 comments on commit 8096855

Please sign in to comment.