i want to search number in a text file and find its line(like index) and returns it.numbers are written line by line to the file.my method:

```
static int Src(int num)  
{
    int c=0;
    Scanner s=new Scanner(f); 
    while(s.hasNextInt())
     {
        c++;
        int l=s.nextInt();
        if(l==k)
          return c;
     }   
     return -1;
    }

```

but nothing happens.any tips?