Re: how to remove parentheses from the output of a source code block
Hi. Greg. > "Greg" == Greg Minshall writes: Greg> Andrés, this is maybe more of an e-lisp question, or, at least, here's more of an e-lisp Greg> answer. if you have the useful =s= package [1] installed, then will using =s-join= give Greg> you what you want? [...] Yest that elisp snippet help me. And It gave me what I was looking for. I just did: s/(s-join " " sqlcode)/(with-temp-buffer (insert (format "%s" sqlcode)) (delete-rectangle (point-min) (point-max)) (buffer-string))/ Best Regards
Re: how to remove parentheses from the output of a source code block
Andrés, sorry -- of course, you can use base e-lisp =string-join= to accomplish the same thing. #+BEGIN_SRC emacs-lisp :var table=source-in-table :results value raw (let ((sqlcode (mapcar (lambda (row) (concat "INSERT or ignore INTO labels_catalog (id, macro, language1, language2) VALUES (" (number-to-string (nth 0 row)) ", '" (nth 1 row) "', '" (nth 2 row) "', '" (nth 3 row) "');\n") ) table))) (string-join sqlcode " ")) #+END_SRC cheers, Greg
Re: how to remove parentheses from the output of a source code block
Andrés, this is maybe more of an e-lisp question, or, at least, here's more of an e-lisp answer. if you have the useful =s= package [1] installed, then will using =s-join= give you what you want? (let ((sqlcode (mapcar (lambda (row) (concat "INSERT or ignore INTO labels_catalog (id, macro, language1, language2) VALUES (" (number-to-string (nth 0 row)) ", '" (nth 1 row) "', '" (nth 2 row) "', '" (nth 3 row) "');\n") ) table))) (s-join " " sqlcode)) give you what you are looking for? cheers, Greg [1] https://github.com/magnars/s.el