title: Spring batch database to fixed format file program - issue with output into the file
body: <p>I have a spring batch program where I am writing from database to a fixed format file.</p>
  
  <p>My database table consist of 5 columns. All the columns contain description about some product. The column are of type varchar with each sized 200. </p>
  
  <p>I am reading the descriptions from the columns in to my pojo as 5 String properties viz. desc1, desc2, desc3, desc4, desc5.</p>
  
  <p>My item writer looks like below:</p>
  
  <pre><code>&lt;beans:bean id="DbToFileItemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter" scope="step"&gt;
      &lt;beans:property name="resource" value="file:c:\TestData\output.dat" /&gt; 
  
      &lt;beans:property name="lineAggregator"&gt;
          &lt;beans:bean class="org.springframework.batch.item.file.transform.FormatterLineAggregator"&gt;
              &lt;beans:property name="fieldExtractor"&gt;
                  &lt;beans:bean class="org.springframework.batch.item.file.transform.BeanWrapperFieldExtractor"&gt;
                   &lt;beans:property name="names" value="desc1, desc2, desc3, desc4, desc5" /&gt; 
                  &lt;/beans:bean&gt;
              &lt;/beans:property&gt;
  
              &lt;beans:property name="format" value="%-20s%-30s%-30s%-30s%-30s" /&gt; 
          &lt;/beans:bean&gt;
      &lt;/beans:property&gt;
  &lt;/beans:bean&gt;
  </code></pre>
  
  <p>As shown I want desc1 to be in a fixed length field of 20 characters and desc2 through desc4 into fixed length field of 30 characters each into the file. </p>
  
  <p>However, the issue is, I am getting the whole desc string irrespective of the size. That is, if desc1 is 40 characters from database, it is coming as 40 characters in the file as well.</p>
  
  <p>I feel it should only take the first 20 characters and ignore the rest. </p>
  
  <p>What is the issue? Is it a bug or am I doing something wrong ?</p>
  
  <p>Thanks for reading!</p>