问题
I have few records with double quotes in between the field values.
So When i use FlatFileItemReader it throws FlatFileParseException for those records.
The Sample Record is:
7^A3989815^A2400284298^ABU^AA" - CLEANING INC.^A$
How do we handle this kind of records in Spring Batch Item Readers?
Regards, Shankar
回答1:
You can change default quote character to something which you are sure will not appear as suggested here. We had similar problems and changed it to @
as suggested and it works, but that gives potentially new problem, if @
appears it will break.
Other solution would be to override DelimitedLineTokenizer
and to always return false
from method isQuoteCharacter
as proposed here which is better solution IMO.
来源:https://stackoverflow.com/questions/29099559/spring-batch-flatfileparseexception-record-with-double-quotes