summaryrefslogtreecommitdiff
path: root/it_pipe.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_pipe.class')
-rw-r--r--it_pipe.class3
1 files changed, 2 insertions, 1 deletions
diff --git a/it_pipe.class b/it_pipe.class
index 3bfcfff..0567ec3 100644
--- a/it_pipe.class
+++ b/it_pipe.class
@@ -95,7 +95,8 @@ function cols($collist)
*/
function csv()
{
- $splitchar = it::match("\t", $this->lines[0]) ? "\t" : ",";
+ $counts = count_chars($this->lines[0]);
+ $splitchar = $counts[ord("\t")] ? "\t" : ($counts[ord(";")] > $counts[ord(",")] ? ";" : ",");
$schema = str_getcsv(trim(array_shift($this->lines), "#\n"), $splitchar, '"'); # could do a function_exists('str_getcsv') here...
$oldlocale = setlocale(LC_CTYPE, 'de_CH.iso-8859-1');