Task/File/Csv/CsvSplitterTask.php
public function execute(ProcessState $state)
    {
        $options = $this->getOptions($state);
        if (null === $this->csv) {
            $headers = $this->getHeaders($state, $options);
            $csv = new CsvFile(
                $options['file_path'],
                $options['delimiter'],
                $options['enclosure'],
                $options['escape'],
                $headers,
                $options['mode']
            );

            if ($csv->getLineCount() > $options['max_lines']) {
                $this->logger->debug("Found big CSV file ({$csv->getLineCount()} lines), splitting...");
            }
            $this->csv = $csv;
        }

        // Return a temporary file containing a limited number of lines
        $state->setOutput($this->splitCsv($this->csv, $options['max_lines']));
    }
public function execute(ProcessState $state)
    {
        $options = $this->getOptions($state);
        if (null === $this->csv) {
            $headers = $this->getHeaders($state, $options);
            $csv = new CsvFile(
                $options['file_path'],
                $options['delimiter'],
                $options['enclosure'],
                $options['escape'],
                $headers,
                $options['mode']
            );

            if ($csv->getLineCount() > $options['max_lines']) {
                $this->logger->debug("Found big CSV file ({$csv->getLineCount()} lines), splitting...");
            }
            $this->csv = $csv;
        }

        // Return a temporary file containing a limited number of lines
        $state->setOutput($this->splitCsv($this->csv, $options['max_lines']));
    }
@param ProcessState $state

@throws \Symfony\Component\OptionsResolver\Exception\ExceptionInterface
@throws \Symfony\Component\Filesystem\Exception\IOException
@throws \LogicException
@throws \UnexpectedValueException
@throws \RuntimeException