Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 28 |
Nodes: | 6 (1 / 5) |
Uptime: | 27:55:34 |
Calls: | 450 |
Files: | 1,047 |
Messages: | 93,314 |
If I want to parse a file:
stuff
stuff
stuff
stuff
stuff
...
...
//[start]
1. Read This text here
2. Read This text here
3. Read This text here
//[end]
...
...
One Way,
(defun read-//[start]-to-//[end] (file)
(with-open-file (*standard-input* file :direction :input)
(loop for line = (read-line)
while (not (string= "//[start]" line :end2 (min (length line) 9))))
(loop for line = (read-line)
while (not (string= "//[end]" line :end2 (min 7 (length line)))) collect
line)))
CL-USER 1 > (read-//[start]-to-//[end] "test.txt")
("1. Read This text here" "2. Read This text here" "3. Read This text here")