Read::readn ReadList::readn Skip::readn
Examples
Basic Examples (2)
The characters read from the stream are not valid in Number format:
Module[{s = StringToStream["{1.7, 3.5, 2.2}"], result},
result = ReadList[s, Number];
Close[s];
result
]This stream can be read in Expression format:
Module[{s = StringToStream["{1.7, 3.5, 2.2}"], result},
result = ReadList[s, Expression];
Close[s];
result
]The commas in the input stream are not valid in Number format:
Module[{s = StringToStream["1.7, 2.4, 3.5"], result},
result = ReadList[s, Number];
Close[s];
result
]The data in this example can be read in Word format and converted to numbers using ToExpression:
Module[{s = StringToStream["1.7, 2.4, 3.5"], result},
result = ReadList[s, Word, WordSeparators -> ","];
Close[s];
ToExpression /@ result
]