ReadList["test.dat", Table[Record, {3}], RecordSeparators -> {" ", "\n"}] /.
"-1.#IND00" -> Indeterminate // ToExpression
One can also use the RecordLists -> True
option for irregular data.
You can also use -1.#IND00
as RecordSeperators
and they'll be skipped during the reading of the data. e.g.
ReadList["test.dat", Record, RecordSeparators -> {" ", "\n", "-1.#IND00"}]
It seems the best way is to use Word
and related options. The following takes care of irregular data.
ReadList["test.dat", Word, WordSeparators -> {" ", "-1.#IND00"}, RecordLists -> True] //
ToExpression
{{1., 0., 3.}, {4.}, {5., 6.}}
I have omitted the Indeterminate
data. to include it just do:
ReadList["test.dat", Word, WordSeparators -> {" "}, RecordLists -> True] /.
"-1.#IND00" -> Indeterminate // ToExpression
{{1., 0., 3.}, {4., Indeterminate, Indeterminate}, {5., 6., Indeterminate}}