I need to create a flat file from database table with fixed field length
<p>The export needs to be fixed length file that means each field will have predefined location and length like below:</p>

<pre><code>Field A: 20 char

Field B: 15 char

Field C: 10 char
</code></pre>

<p>For following values:</p>

<pre>
<strong>Field A                 Field B                  Field C</strong>
Test 1                  Test 2                   Test 3
This is value 1         This is value 2          This is va
</pre>

<p>Flat file contents should be:</p>

<pre>
Test 1              Test 2         Test 3    
This is value 1     This is value 2This is va
</pre>

<p>like Test 1 field have all 20 character including space up to the field Test 2 and same as Test 2 field have 15 character up to field Test 3 and Test 3 field also have 15 character up to end including spaces.</p>

<p>please tell me solution for this either i want to generate it from sql server database table or by c# coding  any way.</p>
