You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 19, 2023. It is now read-only.
A coworker of mine needed a CSV to be filtered this week and it involved something a little more complex than what Excel offers out of the box. So my thought was to use Coseva to filter the list and then write that back to a CSV format after parsing.
Here was the quick & dirty method I used to accomplish the task:
/** * Write the parsed rows to a new CSV file. * * @return object \Coseva\CSV instance */publicfunctiontoCSV($filename)
{
if (!isset($this->_rows)) $this->parse();
$file = newSplFileObject($filename, 'w');
foreach ($this->_rowsas$row) {
$file->fputcsv($row);
}
return$this;
}
Now I just need to make this a little more flexible...