title: FileHelpers: mixing Delimited and Fixed Length Records
body: <p>Here I have to write out a file which records are Pipe Separated, using FileHelpers and C#. Great part of fields have variable length (so, my records would be [DelimitedRecord("|")] ). But some fields must have fixed length (they must have paddings, specific format and so on).</p>
  
  <p>I've googled a bunch with no goal on how to accomplish that.</p>
  
  <p>Example:</p>
  
  <pre><code>[DelimitedRecord("|")]
  public class Customer
  {
      public int CustId; //variable length
  
      public string Name; //variable length
  
      public decimal Balance; //variable length
  
      [FieldConverter(ConverterKind.Date, "dd-MM-yyyy")]
      public DateTime AddedDate;
  
      public int Code; // this one must have 10 characters with "zero-fill", like
               // 153 must look like 0000000153
  
  }
  </code></pre>
  
  <p>How do I accomplish that? Do I have to use a Converter approach and write my own converter for this?</p>
  
  <p>Thank you in advance.</p>