title: Parsing messages with variable length arrays of fixed length fields
body: <p>I have a need to parse (and build) fixed length text based messages that may in some cases contain array fields.<br>
  Example:  </p>
  
  <blockquote>
    <p>PARTA     LOTA      02SUBLOT1   SUBLOT2   03TEST1     RESULT1   TEST2     RESULT2   TEST3     RESULT3   </p>
  </blockquote>
  
  <p>If this were an object, it might use the Lot object below.<br>
  Part Number (PARTA)<br>
  Lot Number (LOTA)<br>
  An Array of 2 SubLot Objects (SUBLOT1 with quantity 150 and SUBLOT2 with Quantity 999)<br>
  An Array of 3 Test Results (TEST1 with result 1234.67890, ...)<br>
  Note that the number of array items is specified in the message.</p>
  
  <p>I was hoping to use the FileHelpers library that I've seen people talking about, but it doesn't appear to support multiple array fields where there is another field specifying the quantity, and it doesn't support field types that themselves have the attribute of [FixedLengthRecord()].</p>
  
  <p>This is what I would like to be able to do.  Note that the field length of 10 is just an artifact of keeping this simple.  Not all fields would normally be defined with the same length.</p>
  
  <pre><code>[FixedLengthRecord()]
  public class Lot
  {
      [FieldFixedLength(10)]
      public string PartNumber { get; set; }
      [FieldFixedLength(10)]
      public string LotNumber { get; set; }
      [FieldFixedLength(10)]
      public SubLot[] SubLots { get; set; }
      [FieldFixedLength(10)]
      public Test[] Tests { get; set; }
  }
  
  [FixedLengthRecord()]
  public class SubLot
  {
      [FieldFixedLength(10)]
      public string SubLotNumber { get; set; }
      [FieldFixedLength(10)]
      public int Quantity { get; set; }
  }
  
  [FixedLengthRecord()]
  public class Test
  {
      [FieldFixedLength(10)]
      public string Description { get; set; }
      [FieldFixedLength(10)]
      public double Result { get; set; }
  }
  </code></pre>
  
  <p>Anyone have any idea if this is possible with FileHelpers?  Any other ideas?  I have many different message types so I would rather not manually code for each one.  The attribute decoration method in FileHelpers seems like a great clean solution and I'm considering just extending it, but I want to make sure I'm not missing a better solution out there.</p>