mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Updates for delimiter detection
This commit is contained in:
parent
974b342333
commit
79c293ec93
@ -140,6 +140,10 @@ class BaseImport
|
|||||||
$delimiters = [',', '.', ';', '|'];
|
$delimiters = [',', '.', ';', '|'];
|
||||||
$bestDelimiter = ',';
|
$bestDelimiter = ',';
|
||||||
$count = 0;
|
$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) {
|
foreach ($delimiters as $delimiter) {
|
||||||
|
|
||||||
if (substr_count(strstr($csvfile, "\n", true), $delimiter) >= $count) {
|
if (substr_count(strstr($csvfile, "\n", true), $delimiter) >= $count) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user