Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 40 |
Nodes: | 6 (0 / 6) |
Uptime: | 10:17:04 |
Calls: | 291 |
Files: | 910 |
Messages: | 76,423 |
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")