Skip to content

Make the API more fluent #7

@achrafAa

Description

@achrafAa

for example :

// Initialize CSV reader for the input file
$csvReader = new SplCsvReader();
$csvReader->setFilePath($inputFile);

// Get and display the record count from the input file
$inputRecordCount = $csvReader->countRecords();
$this->info("Input record count: {$inputRecordCount}");

// Initialize CSV writer for the output file
$csvWriter = new SplCsvWriter();
$csvWriter->setFilePath($outputFile);

// Process and write records from the input file to the output file
while ($csvReader->hasMoreRecords()) {
$record = $csvReader->readNextRecord();
$csvWriter->writeRecord($record);
}
$this->info('Data successfully written to output.csv');

// Verify the output file by reading its record count
$csvReader->setFilePath($outputFile);
$outputRecordCount = $csvReader->countRecords();
$this->info("Output record count: {$outputRecordCount}");

waiting for more data from LinkedIn before starting the changes

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions