title: tcl command to search for a particular word inside a txt file in linux
body: <p>I need to write a tcl script that will process the lines of a text file.  The file is looks like</p>
  
  <pre><code>10.77.33.247    10.77.33.241        rtp 0x26
  10.77.33.247    10.77.33.241        rtp 0x26
  10.77.33.247    10.77.33.241        rtp 0x26
  10.77.33.247    10.77.33.241            0x24
  10.77.33.247    10.77.33.241            0x22
  10.77.33.247    10.77.33.241            0x21
  </code></pre>
  
  <p>I need to be able to iterate through the file and for each line that contains <code>rtp</code> store the value that comes after it (e.g., <code>0x26</code> in the sample above) in a variable to do use in other parts of the script.</p>