From 573f49eb873651f1fecfda352007da8429e2bc8a Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 14 Sep 2021 13:34:39 +0530 Subject: Abstract out deleting substrings. * dump.scm (delete-substrings): New function. (dump-publication): Replace string-replace-substring with delete-substrings. --- dump.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'dump.scm') diff --git a/dump.scm b/dump.scm index 88e0bbc..0e57a03 100755 --- a/dump.scm +++ b/dump.scm @@ -75,6 +75,11 @@ ;;; Dump tables +(define (delete-substrings str . substrings) + (fold (lambda (substring result) + (string-replace-substring result substring "")) + str + substrings)) (define (snake->lower-camel str) (let ((char-list (string->list str))) @@ -244,7 +249,7 @@ Lab_code, Submitter, Owner, Authorized_Users FROM Phenotype")) ;; TODO: Handle unprintable ;; characters better. (list (cons 'gn:abstract - (string-replace-substring abstract "\x01" "")))) + (delete-substrings abstract "\x01")))) (x (list x))) (process-metadata-alist alist)) id))) -- cgit v1.2.3