1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Updates for delimiter detection

This commit is contained in:
David Bomba 2024-01-10 12:50:01 +11:00
parent 974b342333
commit 79c293ec93

View File

@ -140,6 +140,10 @@ class BaseImport
$delimiters = [',', '.', ';', '|'];
$bestDelimiter = ',';
$count = 0;
// 10-01-2024 - A better way to resolve the csv file delimiter.
$csvfile = substr($csvfile, 0, strpos($csvfile, "\n"));
foreach ($delimiters as $delimiter) {
if (substr_count(strstr($csvfile, "\n", true), $delimiter) >= $count) {