title: Find HEX value in file and grep the following value
body: <p>I have a 2GB file in raw format. I want to search for all appearance of a specific HEX value "355A3C2F74696D653E" AND collect the following 28 characters.</p>
  
  <p>Example: <code>355A3C2F74696D653E323031312D30342D32365431343A34373A30322D31343A34373A3135</code></p>
  
  <p>In this case I want the output: <code>"323031312D30342D32365431343A34373A30322D31343A34373A3135"</code> or better: <code>2011-04-26T14:47:02-14:47:15</code></p>
  
  <p>I have tried with </p>
  
  <pre><code>xxd -u InputFile | grep '355A3C2F74696D653E' | cut -c 1-28 &gt; OutputFile.txt
  </code></pre>
  
  <p>and </p>
  
  <pre><code>xxd -u -ps -c 4000000 InputFile | grep '355A3C2F74696D653E' | cut -b 1-28 &gt; OutputFile.txt
  </code></pre>
  
  <p>But I can't get it working.</p>
  
  <p>Can anybody give me a hint?</p>