Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 28 |
Nodes: | 6 (0 / 6) |
Uptime: | 75:51:32 |
Calls: | 452 |
Calls today: | 1 |
Files: | 1,049 |
D/L today: |
75 files (38,717K bytes) |
Messages: | 95,413 |
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")