I meant to include the code for
the four arg version of read_data:
-----------------------------------------------
read_data([%v]) :=
block ([%s,%r,%l,%filename,%dsep,%mult:true,%mix:false,
%whole:[],%ln],
%filename : part (%v,1),
if not stringp (%filename)
then ( disp (" file name must be a Maxima string "),
return (false)),
if not file_search (%filename) then
(disp (" file not found "),return (false)),
if length (%v) = 1 then %mix : true
else if length(%v) = 2 then %dsep : part (%v,2)
else if length (%v) = 3 then (%dsep : part (%v,2), %mult : part
(%v,3))
else (%dsep : part (%v,2), %mult : part (%v,3),%whole : part(%v,4)),
%s : openr (%filename),
%r : [],
%ln : 0,
while (%l : readline(%s)) # false do
( %ln : %ln + 1,
if not lfreeof (%whole,%ln) then
%r : cons (parse_string (%l),%r)
else if %mix then
%r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r)
else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r)),
close (%s),
reverse (%r))$
-----------------
ted