- print_r(array_filter($n));
- }
- exit;
- if (empty($cols)) {
- $this->jerr("could not find a row with " . implode(' / ', $req));
+
+
+ if(!strlen(trim(implode('', $n)))){ // blank line;
+ if ($header) {
+ continue;
+ }
+ $header = true;
+ continue;
+ }
+
+ if(!$header){
+ $extra[preg_replace(array('/\s/', '/\:/'), '', $n[0])] = $n[1];
+ continue;
+ }
+
+ if(!$cols){
+ $cols = array();
+ foreach($n as $k) {
+ $cols[] = strtoupper(trim($k));
+ }
+
+ if (empty($cols)) {
+ continue;
+ }
+
+
+ continue;
+ }
+
+ foreach($cols as $i=>$k) {
+ $row[$k] = $n[$i];
+ }
+ $rows[] = $row;
+