$read(filename, [ntswfL], [matchtext], N)

$read(filename, f, *whatever*, 0)
Would return the total times *whatever* was found in filename.

$read(filename, f, *whatever*, 1)
Would return the first line found contatining *whatever*

$read(filename, fL, *whatever*, 1)
Would return on which line the first occurence of *whatever* was found.

Just an idea..