title: How to skip blank lines in CSV using FlatFileItemReader and chunks
body: <p>I am processing CSV files using FlatFileItemReader.</p>
  
  <p>Sometimes I am getting blank lines within the input file.</p>
  
  <p>When that happened the whole step stops. I want to skipped those lines and proceed normal.</p>
  
  <p>I tried to add <strong>exception handler</strong> to the step in order to catch the execption instead of having the whole step stooped:</p>
  
  <pre><code>@Bean
      public Step processSnidUploadedFileStep() {
          return stepBuilderFactory.get("processSnidFileStep")
                  .&lt;MyDTO, MyDTO&gt;chunk(numOfProcessingChunksPerFile) 
                  .reader(snidFileReader(OVERRIDDEN_BY_EXPRESSION))
                  .processor(manualUploadAsyncItemProcessor())
                  .writer(manualUploadAsyncItemWriter())
                  .listener(logProcessListener)
                  .throttleLimit(20)
                  .taskExecutor(infrastructureConfigurationConfig.taskJobExecutor())
                  .exceptionHandler((context, throwable) -&gt; logger.error("Skipping record on file. cause="+ ((FlatFileParseException)throwable).getCause()))
                  .build();
      }
  </code></pre>
  
  <p>Since I am processing with <strong>chunks</strong> when blank line arrives and exception is catched what's happens is that the whole chunk is <strong>skipped</strong>(the chunk might contains valid lines on CSV file and they are skipped aswell)</p>
  
  <p>Any idea how to do this right when processing file in chunks?</p>
  
  <p>Thanks,
  ray.</p>
  
  <p>After editing my code. still not skipping:</p>
  
  <pre><code>public Step processSnidUploadedFileStep() {
          SimpleStepBuilder&lt;MyDTO, MyDTO&gt; builder = new SimpleStepBuilder&lt;MyDTO, MyDTO&gt;(stepBuilderFactory.get("processSnidFileStep"));
         return builder
                  .&lt;PushItemDTO, PushItemDTO&gt;chunk(numOfProcessingChunksPerFile)
                  .faultTolerant().skip(FlatFileParseException.class)
                  .reader(snidFileReader(OVERRIDDEN_BY_EXPRESSION))
                  .processor(manualUploadAsyncItemProcessor())
                  .writer(manualUploadAsyncItemWriter())
                  .listener(logProcessListener)
                  .throttleLimit(20)
                  .taskExecutor(infrastructureConfigurationConfig.taskJobExecutor())
                  .build();
      }
  </code></pre>