[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
how to remove parentheses from the output of a source code block
From: |
Andrés Ramírez |
Subject: |
how to remove parentheses from the output of a source code block |
Date: |
Wed, 28 Sep 2022 03:17:52 +0000 |
Hi.
I have this file:
--8<---------------cut here---------------start------------->8---
* labels table
** work on this file then move the output to the required buffers
#+name: source-in-table
| ID | MACRO_SRC_CODE_HEADER | LANGUAGE1_HEADER | LANGUAGE2_HEADER |
|----+-----------------------+------------------+------------------|
| 1 | LABEL_YES | Si | Yes |
| 2 | LABEL_NO | No | No |
** generate sql
#+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)))
sqlcode)
#+END_SRC
--8<---------------cut here---------------end--------------->8---
The above file generates this output:
--8<---------------cut here---------------start------------->8---
#+RESULTS:
(INSERT or ignore INTO labels_catalog (id, macro, language1, language2) VALUES
(1, 'LABEL_YES', 'Si', 'Yes');
INSERT or ignore INTO labels_catalog (id, macro, language1, language2) VALUES
(2, 'LABEL_NO', 'No', 'No');
)
--8<---------------cut here---------------end--------------->8---
How could be removed the parentheses from the output?
Best Regards
- how to remove parentheses from the output of a source code block,
Andrés Ramírez <=