Skip to content

Commit

Permalink
feat: Updated src/Snps/IO/CsvReader.php
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Mar 12, 2024
1 parent 2f008e9 commit e5ebcc9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Snps/IO/CsvReader.php
Expand Up @@ -35,6 +35,12 @@ public function setColumnNames($columnNames)
}

public function setColumnTypes($columnTypes)
private $enclosure;

public function setEnclosure($enclosure)
{
$this->enclosure = $enclosure;
}
{
$this->columnTypes = $columnTypes;
}
Expand All @@ -45,10 +51,10 @@ public function read()

if (($handle = fopen($this->filePath, "r")) !== false) {
if ($this->header) {
fgetcsv($handle, 0, $this->separator); // Skip the header row
fgetcsv($handle, 0, $this->separator, $this->enclosure); // Skip the header row
}

while (($row = fgetcsv($handle, 0, $this->separator)) !== false) {
while (($row = fgetcsv($handle, 0, $this->separator, $this->enclosure)) !== false) {
if (!empty($this->columnNames)) {
print_r($row);
$row = array_combine($this->columnNames, $row);
Expand Down

0 comments on commit e5ebcc9

Please sign in to comment.