[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: return column from table as a column
From: |
Roger Mason |
Subject: |
Re: return column from table as a column |
Date: |
Sat, 14 Aug 2021 08:00:11 -0230 |
User-agent: |
mu4e 1.5.6; emacs 27.2 |
Hello Juan,
Juan Manuel Macías writes:
> You're welcome. Just a minor fix: although the code works fine,
> naturally the asterisk in `let' was unnecessary. This is a new version
> with the code explained, in case you find it useful:
>
> #+begin_src emacs-lisp :var data=s1 col=3
> (let* (
> ;; return a list from elemens in column number `col'
> (list-from-column (mapcar (lambda (r) (format "%s" (nth col r))) data))
> ;; make a list of lists = a new table that contains one single column
> (new-table (mapcar 'list list-from-column)))
> new-table)
> #+end_src
Many thanks for this. A looong time ago I was capable of programming in
emacs-lisp. Alas I have not maintained my skills.
Best wishes,
Roger