Skip to main content
added 217 characters in body
Source Link
RunnyKine
  • 33.3k
  • 3
  • 110
  • 176
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}}

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"}]
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}}

added 196 characters in body
Source Link
RunnyKine
  • 33.3k
  • 3
  • 110
  • 176
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"}]
ReadList["test.dat", Table[Record, {3}], RecordSeparators -> {" ", "\n"}] /. 
  "-1.#IND00" -> Indeterminate // ToExpression

One can also use the RecordLists -> True option for irregular data.

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"}]
added 73 characters in body
Source Link
RunnyKine
  • 33.3k
  • 3
  • 110
  • 176
ReadList["test.dat", Table[Record, {3}], RecordSeparators -> {" ", "\n"}] /. 
  "-1.#IND00" -> Indeterminate // ToExpression

One can also use the RecordLists -> True option for irregular data.

ReadList["test.dat", Table[Record, {3}], RecordSeparators -> {" ", "\n"}] /. 
  "-1.#IND00" -> Indeterminate // ToExpression
ReadList["test.dat", Table[Record, {3}], RecordSeparators -> {" ", "\n"}] /. 
  "-1.#IND00" -> Indeterminate // ToExpression

One can also use the RecordLists -> True option for irregular data.

Source Link
RunnyKine
  • 33.3k
  • 3
  • 110
  • 176
Loading