fixedlength icon indicating copy to clipboard operation
fixedlength copied to clipboard

Option to not remove whitespace

Open cbuchmann opened this issue 1 year ago • 1 comments

Hi,

Thanks for a great library. I have a case where we have fields that sometimes only contains white spaces. What happens now is that the field is set to null when parsed. I would like some global option to keep the whitespace.

cbuchmann avatar Aug 16 '24 12:08 cbuchmann

Hey, @cbuchmann

you could customize your solution, there is custom predicate to pass line into processing, I've merged it now for version 0.11, try it :)

g0ddest avatar Aug 20 '24 15:08 g0ddest

Hey, @cbuchmann , I've re-readed your issue and looks like I misunderstood the issue. Anyway, I've update code to add support of this case, check out version 0.13 for the solution, take a look at allowEmptyStrings attribute of FixedField annotation, for example: @FixedField(offset = 1, length = 3, padding = Character.MIN_VALUE, allowEmptyStrings = true) I'm closing the issue, if you have any more problems don't hesitate to open a new one! Thank you for great enhancement proposal!

g0ddest avatar Oct 13 '24 12:10 g0ddest