title: Parsing a binary file with multiple data types into an array
body: <p>I've created multiple binary files, each containing 2 strings, 2 chars, 1 double, and 1 int. The data, when read, is </p>
  
  <pre class="lang-none prettyprint-override"><code>Fokker DR 1 
  Germany 
  D 
  A 
  1000.0 
  13
  </code></pre>
  
  <p>And the binary file reads as follows:
  <a href="https://i.stack.imgur.com/iuUAM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iuUAM.png" alt="dat file text"></a></p>
  
  <p>I am trying to parse the dat file into an array so I can label each data type with the appropriate name such as </p>
  
  <pre class="lang-none prettyprint-override"><code>Name: Fokker DR 1
  Country: Germany
  Attack Mode: D
  Turn Mode: A
  etc.
  </code></pre>
  
  <p>But I am having trouble because, when trying to use StreamReader and split the binary file at every instance of a whitespace, I run into problems due to the fact that the Name (Fokker DR 1) contains multiple spaces that should not be split.</p>
  
  <p>Here is my code for my attempted split:</p>
  
  <pre><code>if (file.Contains("plane1"))
  {
      StreamReader reader = new StreamReader("plane1.dat");
      string line;
      while ((line = reader.ReadLine()) != null)
      {
          string[] data = line.Split(' ');
          bin.ReadBinary("plane1.dat");
          Console.WriteLine("Name: " + data[0]);
          Console.WriteLine("Country: " + data[1]);
          Console.WriteLine("Turn Mode: " + data[2]);
          Console.WriteLine("Attack Mode: " + data[3]);
          Console.WriteLine("Cost: " + data[4]);
          Console.WriteLine("Max Damage: " + data[5]);
      }
  }
  </code></pre>
  
  <p>Is there any sort of way to split at every instance of a different data type or is there another way to go about labeling the data in my binary file?? </p>