From 827499af71ba1f6fa6e65818768b9317623aeb1d Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 14 Mar 2011 18:25:12 +0000 Subject: handle ; as split char --- it_pipe.class | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'); -- cgit v1.2.3