title: Parsing fix logs for stock and price in column formats using grep /awk/UNIX without knowing position of fields
body: <p>I have a fix log containing trade information such as:</p>
  
  <pre><code>  ==&gt;  8=FIX4.2|39=1|55=IBM|6=138  
    ==&gt;  8=FIX4.2|39=1|55=APPL|6=130  
    ==&gt;  8=FIX4.2|39=1|55=GE|6=11  
  </code></pre>
  
  <p>I'm trying to grep the output so that i can get something like this:</p>
  
  <pre><code> IBM    138  
   APPL   130   
   GE     11  
  </code></pre>
  
  <p>where the first column is IBM and the second column is 138.</p>
  
  <p>I'm trying this:</p>
  
  <pre><code>grep 39=1 some.log | tr "|" "\n" | egrep '(^55=|^6=)' 
  </code></pre>
  
  <p>but this only gets the stock/ price on separate lines like this:</p>
  
  <pre><code>IBM
  AAPL
  GE
  138
  130
  11
  </code></pre>
  
  <p>Is there a bash/unix one liner that will get this?</p>
  
  <p>related to this this post</p>
  
  <p><a href="https://stackoverflow.com/questions/31058956/parsing-fix-logs-for-stock-and-price-in-column-formats-using-grep-awk-unix/31059315?noredirect=1#comment50304860_31059315">Parsing fix logs for stock and price in column formats using grep /awk/UNIX</a></p>
  
  <p>This was solved with this answer:</p>
  
  <pre><code>awk -F '[|=]' '{printf "%-6s %s\n", $8, $10}' file
  </code></pre>
  
  <p>Say i didnt know 8, 10 are the positions of those tags, what is the best way to get that?</p>