Get a frame of lines from a table by filter
Posted: Sun Apr 21, 2019 12:41 am
I have a table like this:
I want to get some continueous lines e.g. from the first line to the third line by this:
But I find the function "filter" does not support "$idx".
So, is there a better way to achieve this?
Code: Select all
(setq lst '(("header1" "header2" "header3") ( "11" "12" "13") ("21" "22" "23") ("31" "32" "33") ("41" "42" "43" )))
Code: Select all
(filter (and (>= $idx 1) (<= $idx 3)) lst) ;; '(( "11" "12" "13") ("21" "22" "23") ("31" "32" "33") ) wanted.
So, is there a better way to achieve this?