Code: Select all
text-a1 text-b1 1
text-a2 text-b2 2.98
text-a3 text-b3 3.6
Code: Select all
(defun myload (file-name)
(let ((t1) (t2) (n))
(with-open-file (in file-name :direction :input :if-does-not-exist :error)
(loop for line = (read-line in nil) while line do (progn
(with-input-from-string (ss line)
(setf t1 (read ss))
(setf t2 (read ss))
(setf n (read ss))
(print (concatenate 'string t1 t2)) (princ n)))))))
(myload "source.txt")
*** - CONCATENATE: TEXT-A1 is not a SEQUANCE
But how to get a string from a stream?
(read) works fine for numbers, but why not for strings? What am I missing?