title: i want to search strings from domain file in log file...for reading two files i used nested loops...incorrect output
body: <pre><code>while((sline= bbr.readLine()) != null) {
      while ((line = br.readLine()) != null){
          if (line.contains(sline)){
              tracker.append(line); tracker.append("\n  ");tracker.append("\n  ");    
              String track = new String(tracker.toString()); 
              writeToFile(c,track,"trackingInfo.txt");
          }
      }// end of while1
  }// end of while2
  br.close();
  bbr.close();
  </code></pre>
  
  <p>I use the nested loops first for reading domain file and second for the logfile. But for the first string from domain file it searches whole log file but not for the other strings in domain file. </p>