Allow _guess_delimiter to work with a single row of data

Fix #206
This commit is contained in:
Fonata
2021-10-16 18:28:19 +02:00
committed by Fonata
parent d5606f8b2a
commit 5d4643b201
3 changed files with 11 additions and 1 deletions

View File

@@ -1261,7 +1261,7 @@ class Csv {
}
}
if ($equal) {
if ($equal || $depth === 1) {
$match = $almost ? 2 : 1;
$pref = strpos($preferred, $char);
$pref = ($pref !== false) ? str_pad($pref, 3, '0', STR_PAD_LEFT) : '999';