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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -