This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

FindList

FindList
gives a list of lines in the file that contain the specified string.
FindList
gives a list of all lines that contain any of the specified strings.
FindList
gives a list of lines containing the specified strings in any of the .
FindList
includes only the first n lines found.
  • FindList returns if it fails to find any record which contains the specified text.
  • The following options can be given:
AnchoredSearchFalsewhether to require that the text searched for be at the beginning of a record
IgnoreCaseFalsewhether to treat lowercase and uppercase as equivalent
RecordSeparators{"\r\n", "\n","\r"}separators for records
WordSearchFalsewhether to require that the text searched for appear as a word
WordSeparators{" ","\t"}separators for words
  • The first argument to FindList can be InputStream, or simply if there is only one open input stream with the specified name.
  • If FindList opens a file or pipe, it closes it again when it has finished.
Get a list of lines in a file that contains :
The first two lines that contain :
Get a list of lines in a file that contains :
In[1]:=
Click for copyable input
Out[1]=
 
The first two lines that contain :
In[1]:=
Click for copyable input
Out[1]=
New in 2