Read-line for .lsp

Read-line for .lsp

Anonymous
Not applicable
1,529 Views
3 Replies
Message 1 of 4

Read-line for .lsp

Anonymous
Not applicable

Is there a way to "read-line" on a Lisp file? I'm looking to be able to compare a number between 2 different files, and my attempts thus far have bore no fruit.  I'd appreciate any advice on the subject.

0 Likes
Accepted solutions (1)
1,530 Views
3 Replies
Replies (3)
Message 2 of 4

dgorsman
Consultant
Consultant
Accepted solution

Comparing text files?  Look into a diff generator such as WinDiff or TortoiseMerge.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes
Message 3 of 4

_gile
Consultant
Consultant

Hi,

You can read a .lsp fine as any other text file.

(setq file (open (findfile "edge.lsp") "r"))
(while (setq line (read-line file))
  (setq lst (cons line lst))
)
(close file)
(reverse lst)


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 4 of 4

Anonymous
Not applicable

Tortoise looks like it's exactly what I looking for, Thanks.

0 Likes