title: Splitting binary file content in two parts using single byte separator in python
body: <p>I have a file consisting in three parts:</p>
  
  <ol>
  <li>Xml header (unicode);</li>
  <li>ASCII character <code>29</code> (group separator);</li>
  <li>A numeric stream to the end of file</li>
  </ol>
  
  <p>I want to get one xml string from the first part, and the numeric stream (to be parsed with <code>struct.unpack</code> or <code>array.fromfile</code>).</p>
  
  <p>Should I create an empty string and add to it reading the file byte by byte until I find the separator, like shown <a href="https://stackoverflow.com/a/1035360/401828">here</a>?</p>
  
  <p>Or is there a way to read everything and use something like <code>xmlstring = open('file.dat', 'rb').read().split(chr(29))[0]</code> (which by the way doesn't work) ?</p>
  
  <p>EDIT: this is what I see using a hex editor: the separator is there (selected byte)</p>
  
  <p><img src="https://i.stack.imgur.com/aRJqj.png" alt="enter image description here"></p>