Existence of a string in a file

Hi,

I want to know whether a string or variable is exists in a perticular file or not.

I want to use IF command in cshell.
I am not sure how to use it.

can any one help me..

something like this ?

I am not sure about the cshell.. try it out

 
if ( grep $variable filename )
{
        #your code
}

thanks for your help