Subject: Read data file containing fractional numbers?
From: Edwin Woollett
Date: Thu, 19 May 2011 14:58:12 -0700
Given a text data file with either
space or comma separated items which
may include signed fractional numbers,
such as:
1 0
2 -1/3
3 -1/2
4 -3/5
5 -2/3
or
1, 0
2, -1/3
3, -1/2
4, -3/5
5, -2/3
how can I use Maxima to read this data into a nested
list of the form
[ [1,0], [2,-1/3], [3, -1/2], [4, -3/5], [5, -2/3] ] .
My attempts with read_nested_list result in things
like
(%i22) fdataL : read_nested_list ("mydata2.dat",comma);
(%o22) [[1, 0], [2, [- 1, /, 3]], [3, [- 1, /, 2]], [4, [- 3, /, 5]],
[5, [- 2,
/, 3]]]
Ted Woollett