This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Input and Output / File Input  /
ReadList

  • ReadList[" file "] reads all the remaining expressions in a file, and returns a list of them.
  • ReadList[" file ", type ] reads objects of the specified type from a file, until the end of the file is reached. The list of objects read is returned.
  • ReadList[" file ", , , ... ] reads objects with a sequence of types, until the end of the file is reached.
  • ReadList[" file ", types , n ] reads only the first n objects of the specified types.
  • The option setting RecordLists -> True makes ReadList create separate sublists for objects that appear in separate records.
  • With the default setting RecordSeparators -> {"\n"}, RecordLists -> True puts objects on separate lines into separate sublists.
  • The option RecordSeparators gives a list of strings which are taken to delimit records.
  • ReadList takes the same options as Read, with the addition of RecordLists.
  • If file is not already open for reading, ReadList opens it, then closes it when it is finished. If the file is already open, ReadList does not close it at the end.
  • ReadList prints a message if any of the objects remaining in the file are not of the specified types.
  • ReadList[" file ", , ... ] looks for the sequence of in order. If the end of file is reached while part way through the sequence of , EndOfFile is returned in place of the elements in the sequence that have not yet been read.
  • ReadList[ stream ] reads from an open input stream, as returned by OpenRead.
  • See notes for Read.
  • See the Mathematica book: Section 1.11.3Section 2.11.7.
  • See also: FindList.