string pad/rpad/lpad
This commit is contained in:
27
debug.lsp
27
debug.lsp
@@ -18,31 +18,10 @@
|
||||
;; (print (member '(1 2 3) 10))
|
||||
|
||||
|
||||
(define csv_list '())
|
||||
(for f (ls-dir "tests/divi")
|
||||
(if (regex-search? f "^divi.*\.csv$")
|
||||
(do
|
||||
(define filename (+ "tests/divi/" f))
|
||||
; (print filename)
|
||||
(define csv_str (read-file filename))
|
||||
(define csv_file_list (parse-csv csv_str))
|
||||
(define csv_list (+ csv_list csv_file_list))
|
||||
)
|
||||
))
|
||||
|
||||
;; (for x csv_list (print x))
|
||||
(print (string-rpad "rpad0123456789" 10 "x"))
|
||||
(print (string-rpad "rpad " 10 "x"))
|
||||
|
||||
(print (len csv_list))
|
||||
|
||||
(define my_tickers '("FDX" "C" "AIG" "BAC" "BK" "PBF" "PBFX" "SYF" "WFC" "TEVA" "XOM"))
|
||||
|
||||
; (print (filter (lambda (x) (= (first x) "CLX")) csv_list))
|
||||
; (print (filter (lambda (x) (member my_tickers (first x))) csv_list))
|
||||
(define csv_list (filter (lambda (x) (member my_tickers (first x))) csv_list))
|
||||
|
||||
|
||||
(define sorted_list (quick-sort-by csv_list (lambda (a b) (> (str-to-date (second a) "%m/%d/%Y") (str-to-date (second b) "%m/%d/%Y")))))
|
||||
|
||||
(for x csv_list (print x))
|
||||
(print (string-lpad "lpad" 10 "x"))
|
||||
|
||||
(print "Debug ends")
|
||||
|
||||
Reference in New Issue
Block a user