getting FlatFileParseException when there is empty line in my flat file when doing batch processing with spring-batch -
i used below code handling it:
<skippable-exception-classes> <includeclass="org.springframework.batch.item.file.flatfileparseexception"/> </skippable-exception-classes>
but correct way handle empty lines in flat file, avoid seeing flatfileparseexception
, when processing spring batch.
i think accomplish you're looking custom recordseparatorpolicy
. strip out empty lines via recordseparatorpolicy#preprocess
method , return true in recordseparatorpolicy#isendofrecord
once have record text. gotcha you'd have trickery around use case of if file had blank lines @ end of file think it's doable.
Comments
Post a Comment