I'm not sure you can do it with grep (I'm sure someone will point out if I'm wrong
To get the Nth line of a file I've always done (where N is the line number you want):
head -N file | tail -1
So, you could put that into a foreach loop (note, this is tcsh):
foreach FILE (list of files)
foreach? head -2 $FILE | tail -1
foreach? head -35 $FILE | tail -1
p.s. if you can get the "list of files" from a command (like ls) replace it with `command` (those are "back ticks") so it would be "foreach FILE (`ls`)"