Skip to content

auto()/autoDetectionForDataString() cannot determine delimiter with a single row file #206

@atbigelow

Description

@atbigelow

tab_test.csv

Running auto() or autoDetectionForDataString() on the contents of this file does not properly determine the delimiter.

The example of

$csv = new \ParseCsv\Csv();
$csv->auto('tab_test.csv');

Should result in $csv->delimiter being a tab, but it is in fact false.

My workaround at this point is to first check if the file has multiple rows, and if not, re-insert the same string into $file_data so it can work with autoDetectionForDataString, and then call parse on the original string. There doesn't seem to be a way to workaround a straight auto call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions