From ... From: Erik Naggum Subject: Re: Help required: Is there a way to split up one element into several? Date: 2000/03/30 Message-ID: <3163417605117716@naggum.no>#1/1 X-Deja-AN: 604372600 References: <38E32079.69886751@hotmail.com> mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 954430432 17803 195.0.192.66 (30 Mar 2000 15:33:52 GMT) Organization: Naggum Software; vox: +47 8800 8879; fax: +47 8800 8601; http://www.naggum.no User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.5 Mime-Version: 1.0 NNTP-Posting-Date: 30 Mar 2000 15:33:52 GMT Newsgroups: comp.lang.lisp * Erik Halvarsson | From an external file I need to get some data, and it's stored like: | | VKA100 707898.512 78172.497 143.803 | | a simple xyz coordinate. When I use the (readline file) function, that | string becomes one single element in the list I assign it to. What I | need is four different elements in the list but I have so far no clue | how to achive this. Would be great if anyone out there could help me. if each line is known to consist of these four elements, the first looks very much a symbol, and programmer time is more important than much anything else, just use the function read. here's a quick shot at it: (let ((*package* (make-package (gensym) :use ()))) (unwind-protect (loop for line = (loop with first = (read nil) if (not first) then do (loop-finish) else collect (symbol-name first) repeat 3 collect (read )) while line collect line) (delete-package *package*))) #:Erik