Re: Newbie Question
- Posted by Irv Mullins <irvm at ellijay.com> Apr 25, 2001
- 502 views
----- Original Message ----- From: <tpopel at yahoo.com> > I have to do some work with 2 dimensional, comma > delimited text files. > > Is this the kind of thing Euphoria does well? Yes - you'll probably want the strtok.e include file from the RDS website , it makes parsing much easier. > What replaces the old input# statement from basic? gets(fn) -- "gets" a string from fn where fn is the assigned file handle. You might try something like: include strtok.e object data, line atom fn data = {} line = "" fn = open("myfile","r") -- may want to check fn = -1, means can't open file while 1 do line = gets(fn) if atom(line) then exit -- EOF else line = parse(line,',') -- line in = "one,two,three", out = {"one","two","three"} data = append(data,line) -- store it away for later use end if end while Regards, Irv