title: reading a log file with different sequences using shell script
body: <p>I'm a starter with shell scripting and I wanted to ask you a question about reading data from a log file. the file is really long and includes few steps of calculation convergence.</p>
  
  <blockquote>
    <p>step 1</p>
    
    <p>...</p>
    
    <p>converged</p>
    
    <p>final energy : 1000000</p>
    
    <p>step 2</p>
    
    <p>...</p>
    
    <p>converged</p>
    
    <p>final energy : 10000</p>
    
    <p>...</p>
    
    <p>structure optimized</p>
    
    <p>final energy: 100000</p>
  </blockquote>
  
  <p>what I need to do is to first find if the structure is finally optimized if so the read the final energy and some other data. In mathematica I could find the position of structure optimized and do a search from there is the same thing possible in shell?
  I'm a starter please list all the commands I need to use </p>