Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.49 KB

csv_writer_task.md

File metadata and controls

36 lines (27 loc) · 1.49 KB

CsvWriterTask

Write given array to a CSV file, will wait until the end of the previous iteration (this is a blocking task) and outputs the file path.

Task reference

  • Service: CleverAge\ProcessBundle\Task\File\Csv\CsvWriterTask
  • Blocking task

Accepted inputs

array: foreach line, it will need a php array where key match the headers and values are convertible to string. Underlying method is fputcsv.

Possible outputs

string: absolute path of the produced file

Options

Code Type Required Default Description
file_path string X Path of the file to write to (relative to symfony root or absolute). It can also take two placeholders ({date} and {date_time}) to insert timestamps into the filename
delimiter string ; CSV delimiter
enclosure string " CSV enclosure character
escape string \\ CSV escape character
headers array or null null Static list of CSV headers, without the option, it will be dynamically read from first line
mode string wb File open mode (see fopen mode parameter)
split_character string | Used to implode array values
write_headers bool true Write the headers as a first line