      subroutine fgrep(file,string,line,col)
      character(*) file,string
      integer line,col
      logical lex
      character(135) a
      do i=1,99
         if(i>4.and.i<8) cycle
         inquire(i,opened=lex)
         if(.not.lex) then
            open(i,file=file,status='old',err=10)
            line=0
            do
               read(i,'(a)',end=10) a
               line=line+1
               col=index(a,string)
               if(col>0) return
            enddo
 10         continue
            line=0
            return
         endif
      enddo
      return
      end
