OK, i see, but I would call that a split process as you do convert the incoming data to a list of numbers
line by line before the mapcar to get min / max.
I tried to test it but my timing varied so I'm not sure of the results.
(defun c:test_5 (/ f f1 timer ldata data)
;;(c:test_5)
;; ElpanovEvgeniy - Modified
(defun min_max (mi ma l f)
(if l
(if (< mi (car l) ma)
(min_max mi ma (cdr l) f)
(if (< (car l) mi)
(min_max (car l) ma (cdr l) f)
(min_max mi (car l) (cdr l) f)
) ;_ if
) ;_ if
(strcat (itoa mi) " " (itoa ma) "\n")
) ;_ if
) ;_ defun
(setq timer (getvar "millisecs"))
(setq f1 (open "c:\\numbers.csv" "R"))
(while (setq ldata (read-line f1))
(setq data (cons ldata data))
)
(close f1)
(setq f (open "c:\\result.csv" "W"))
(princ
(apply
(function strcat)
(mapcar
(function
(lambda (l)
(setq l (read (strcat "(" (vl-string-translate "," " " l) ")")))
(if (< (car l) (cadr l))
(min_max (car l) (cadr l) (cddr l) f)
(min_max (cadr l) (car l) (cddr l) f)
) ;_ if
) ;_ lambda
) ;_ function
data
) ;_ mapcar
) ;_ apply
f
) ;_ princ
(close f)
(princ
(strcat
"Process took "
(rtos (/ (- (getvar "millisecs") timer) 1000.0) 2 4)
" seconds."
) ;_ strcat
) ;_ princ
(princ)
)