1 (use-modules (ice-9 rdelim))
4 ;; i generated my first "common" column file with `sort -u'
7 (let ((common-file (open-input-file "/tmp/common")))
8 (let q ((line (read-line common-file)) (lines '()))
11 (q (read-line common-file) (cons line lines))))))
14 (map (lambda (x) (string-append "/tmp/" x "100"))
15 '("lh" "mm" "md" "mo" "sw" "mc" "kc")))
17 (define (process-1 file-path)
18 (let ((new-file-path (string-append file-path "-after")))
19 (let ((iport (open-input-file file-path))
20 (oport (open-output-file new-file-path)))
21 (let f ((common-rest common-all) (input-line (read-line iport)))
22 (if (null? common-rest)
26 (display (string-append "finished: " new-file-path))
28 (let* ((common-line (car common-rest))
30 (not (eof-object? input-line))
31 (string=? common-line input-line))))
32 (write-line (if str-eq?
33 (string-append common-line ",")
41 (map process-1 100-list)