-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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