Skip to content

CSV's having "" removed #255

Answered by norberttech
xswirelab asked this question in Q&A
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","[email protected]","(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: 6 comments

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
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #249 on June 09, 2022 21:44.