setDelimiter(';'); //we are creating a CSV from a raw string $rawCsv2Merge = <<setDelimiter(','); /* When merging multiples CSV documents don't forget to set the main CSV object as a `League\Csv\Writer` object with the $open_mode = 'a+' to preserve its content. This setting is of course not required when your main CSV object is created from String */ ?> Merging 2 CSV documents

Using the League\Csv\Writer class to merge two CSV documents

The main Raw CSV

The delimiter is a ";"


The Raw CSV to be merge

The delimiter is a ";"


insertAll($csv2merge); //we are merging both documents as simple as that!!?>

The Raw CSV after merging

Notice that after merging the data is semi-colon ";" separated


Tips

When merging multiples CSV documents don't forget to set the main CSV object as a League\Csv\Writer object with the $open_mode = 'a+' to preserve its content. This setting is of course not required when your main CSV object is created from String