I think what you need to do is extract the file to stdout and pipe it to the command you want, something like
Code:
tar xfO [tar file] [desired file]|grep [pattern]
where [desired file] is the path and filename within the tar file, which must be written exactly as it appears in the list you got from tar tvf.
If you leave off the |grep [pattern] then it'll just dump the file to stdout, as if you'd used cat on a normal file.
We are free to think. We are free to plan. And we are free to do. But once an action has been taken, we are never free from its consequences.
--Russel M. Nelson, apostle.