Reads a json file and iterate on each line, returning decoded content as array. Skips empty lines.
- Service:
CleverAge\ProcessBundle\Task\File\JsonStream\JsonStreamReaderTask - Iterable task
string: Path of the file to read from (absolute)
array: foreach line, it will return content as array.
Underlying method are SplFileObject::fgets and json_decode.
none
# Task configuration level
entry:
service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask'
outputs: read
options:
output:
file_path: '%kernel.project_dir%/var/data/json_stream_reader.json'
read:
service: '@CleverAge\ProcessBundle\Task\File\JsonStream\JsonStreamReaderTask'