title: Split one file into multiple files based on pattern
body: <p>I have a binary file which I convert into a regular file using hexdump and few awk and sed commands. The output file looks something like this - </p>
  
  <pre><code>$cat temp
  3d3d01f87347545002f1d5b2be4ee4d700010100018000cc57e5820000000000000000000
  000000087d3f513000000000000000000000000000000000001001001010f000000000026 
  58783100b354c52658783100b43d3d0000ad6413400103231665f301010b9130194899f2f
  fffffffffff02007c00dc015800a040402802f1d5b2b8ca5674504f433031000000000004
  6363070000000000000000000000000065450000b4fb6b4000393d3d1116cdcc57e58287d
  3f55285a1084b
  </code></pre>
  
  <p>The temp file has few eye catchers (3d3d) which don't repeat that often. They kinda denote a start of new binary record. I need to split the file based on those eye catchers. </p>
  
  <p>My desired output is to have multiple files (based on the number of eyecatchers in my temp file). </p>
  
  <p>So my output would look something like this -</p>
  
  <pre><code>$cat temp1
  3d3d01f87347545002f1d5b2be4ee4d700010100018000cc57e582000000000000000
  0000000000087d3f513000000000000000000000000000000000001001001010f00000000
  002658783100b354c52658783100b4
  
  $cat temp2
  3d3d0000ad6413400103231665f301010b9130194899f2ffffffffffff02007c00dc0
  15800a040402802f1d5b2b8ca5674504f4330310000000000046363070000000000000000
  000000000065450000b4fb6b400039
  
  $cat temp3
  3d3d1116cdcc57e58287d3f55285a1084b
  </code></pre>