I wish to extract certain elements from a list of strings, starting from the string "ENTITIES" and ending at the string "OBJECTS"
So far, i have this to give me elements from the string ENTITIES onwards, but no way to remove elements from the string "OBJECTS" onwards.
(define (test-string2 lst keyword)
(member (string-upcase keyword) lst))
I have also looked at the for function, and this is my attempt but obviously does not work
(define (test-string2 lst keyword)
(cdr (member (string-upcase keyword) lst)))
;return list that matches keyword
(define (test-string3 lst keyword)
(if (string=? (car lst) (string-upcase keyword))
'()
(begin (car lst)
(test-string3 (cdr lst) keyword))))
;return elements in list until keyword is matched
(test-string3 (test-string2 list-of-strings "entities") "objects")
> list-of-strings
'("SECTION"
" 2"
"ENTITIES"
" 0"
"SPLINE"
" 5"
"F7"
"330"
"1F"
"100"
"AcDbEntity"
" 8"
"0"
" 6"
"Continuous"
" 62"
" 5"
"370"
" 0"
"100"
"AcDbSpline"
"OBJECTS"
"3"
"5"
"6"
"6"
"7"
"78")