searching text files...
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
searching text files...

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
avw_410
Guest





Posted: Tue Jan 04, 2005 7:17 pm    Post subject: searching text files... Reply with quote

I need some help here... I have a text file that is like this:

1009
jobname
location
arch
contractor

1010
jobname
location
arch
contractor

etc...

I want to search this text file in lisp to create a list of the
information... is it possible...

TIA
aw

Back to top
mattis
Guest





Posted: Tue Jan 04, 2005 8:14 pm    Post subject: Re: searching text files... Reply with quote

Try this out. Change the text file path in this code to where ever the file is located.

(defun txtlist (/ txtfile eof mytextlist line)
(setq txtfile (open "c:\\mytext.txt" "r"))
(setq eof 1
mytextlist nil)
(while (= eof 1)
(setq line (read-line txtfile))
(if line
(progn
(setq mytextlist (append (list line) mytextlist))
)
(setq eof nil)
)
)
(close txtfile)
(setq mytextlist (reverse mytextlist))
)
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB