tests dir added
This commit is contained in:
@@ -40,3 +40,24 @@
|
||||
|
||||
|
||||
|
||||
; from list of lists creates csv string
|
||||
; (print (make-csv '(("r1c1" "r1c2") ("r2c1" "r2c2"))))
|
||||
(defun make-csv (csv_list)
|
||||
(do
|
||||
(define rows_str "")
|
||||
(define r 0)
|
||||
(for row csv_list
|
||||
(define cols_str "")
|
||||
(define c 0)
|
||||
(for col row
|
||||
(if (= c 0)
|
||||
(define cols_str col)
|
||||
(define cols_str (+ cols_str "," (display col))))
|
||||
(define c (inc c)))
|
||||
(if (= r 0)
|
||||
(define rows_str cols_str)
|
||||
(define rows_str (+ rows_str "\n" cols_str)))
|
||||
(define r (inc r)))
|
||||
|
||||
rows_str
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user