title: unix shell: replace by dictionary
body: <p>I have file which contains some data, like this</p>
  
  <pre><code>2011-01-02 100100 1 
  2011-01-02 100200 0
  2011-01-02 100199 3
  2011-01-02 100235 4
  </code></pre>
  
  <p>and have some "dictionary" in separate file</p>
  
  <pre><code>100100 Event1
  100200 Event2
  100199 Event3
  100235 Event4
  </code></pre>
  
  <p>and I know that</p>
  
  <pre><code>0 - warning
  1 - error
  2 - critical
  etc...
  </code></pre>
  
  <p>I need some script with sed/awk/grep or something else which helps me receive data like this</p>
  
  <pre><code>100100 Event1 Error
  100200 Event2 Warning
  100199 Event3 Critical
  etc
  </code></pre>
  
  <p>will be grateful for ideas how to do this in best way, or for working example</p>
  
  <p><strong>update</strong></p>
  
  <p>sometimes I have data like this</p>
  
  <pre><code>2011-01-02 100100 1
  2011-01-02 sometext 100200 0
  2011-01-02 100199 3
  2011-01-02 sometext 100235 4
  </code></pre>
  
  <p>where sometext = any 6 characters (maybe this is helpful info)
  <br>in this case I need whole data:</p>
  
  <pre><code>2011-01-02 sometext EventNameFromDictionary Error
  </code></pre>
  
  <p>or without "sometext"</p>