Skip to content

CSV's having "" removed #4

Discussion options

You must be logged in to vote

This is pretty much how CSV works.

When flow is loading CSV file into memory it's using PHP function fgetcsv. It's that function that is removing " and when you are dumping output to a regular file only values/columns with space will be surrounded by " which is the default enclosure.

Input

"Company name","Contact owner","First Name","Last Name","Email","Phone Number"
"Some Inc","Dave Young","Dave","Yung","integer@example.com","(312) 768-3103"

Code

<?php

use Flow\ETL\DSL\CSV;
use Flow\ETL\DSL\Stream;
use Flow\ETL\DSL\Transform;
use Flow\ETL\Flow;

require __DIR__ . '/../vendor/autoload.php';

(new Flow())
    ->read(CSV::from(Stream::local_file(__DIR__ . '/issue289.csv')))
    ->rows(Tra…

Replies: 0 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by norberttech
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants