How to search a string in Text file

Hi All,
I had a 200 pages text file.I want to search one particular string ie Transaction ID.(As we dont have access to production box ie reason we are searching logs through browser…It is very difficult to search all pages) …I want to write one service to get page numbers of Particular ID. So that i can easily check the logs.
How to achieve this scenario…
Hope for positive response.

I am not sure i understand the concept of pages in a text file, are you referring to a page on the browser for logs? If you want to search a string in a text file and return the line number of the occurrence then below code will work.

Inputs:
searchString
fileName

outputs:
exists
lineNum
error

IDataCursor pipelineCursor = pipeline.getCursor();
        String    searchString = IDataUtil.getString( pipelineCursor, "searchString" );
        String    fileName = IDataUtil.getString( pipelineCursor, "fileName" );
        pipelineCursor.destroy();
        
        File file=new File(fileName);    
        int lineNum = 0;
        
        try {
            Scanner in = new Scanner(new FileReader(file));
            
            while (in.hasNext()) {
            String inString = in.nextLine().toLowerCase();
            if( inString.indexOf( searchString ) >= 0) 
            {             
                IDataUtil.put( pipelineCursor, "lineNum", Integer.toString(lineNum));
                IDataUtil.put( pipelineCursor, "exists", "true");
                break;
            }
            else{
                IDataUtil.put( pipelineCursor, "exists", "false");
            }
            lineNum++;
            }            
        } catch (FileNotFoundException e) {        
            IDataUtil.put( pipelineCursor, "error", e.toString());
        }
        pipelineCursor.destroy();

Imports:

import java.io.FileReader;
import java.util.Scanner;
import java.io.File;

Cheers,
Akshith