title: String tokenizer and Scanner java
body: <p>I have a large text file which I want to separate into different strings using the delimiter !- (Each string is multiple lines).</p>
  
  <p>I then want to discard all the other strings that do not contain:</p>
  
  <pre><code>===========  ALL OBJECTS IN CLASS: FENESTRATIONSURFACE:DETAILED ===========
  </code></pre>
  
  <p>So far I've got this and its not outputting anything (it complies but no output to console).I'm new to programming and I'm not making much progress after researching this for sometime so any suggestions or pointers would be most appreciated thanks!</p>
  
  <pre><code>public class Main {
      public static void main(String[] args) throws FileNotFoundException {
          File file = new File("C:/Users/Anton/Pictures/1 x geotransform0.5m shading.txt");
          Scanner scan = new Scanner(file);
          while(scan.hasNextLine()){
              StringTokenizer st = new StringTokenizer(scan.nextLine(),"!-");
              if(st.equals("   ===========  ALL OBJECTS IN CLASS: FENESTRATIONSURFACE:DETAILED ===========")) {
                  System.out.print(st);
              }
          }
          scan.close();
      }
  }
  </code></pre>