-
Apr 30th, 2008, 04:47 PM
#1
FlatFileReader Trimming spaces
Hello All,
I am using FlatFileReader with the FixedLengthTokenizer, in which I am mapping names to columns:
<bean id="fileDescriptor" class="org.springframework.batch.item.file.transfo rm.FixedLengthTokenizer">
<property name="names" value="field1" />
<property name="columns" value="1-5" />
</bean>
If following are the values:
abc y
de
xy
Then I would expect the reader to return me "abc y", " de ", "xy " i.e. I would expect it to retain the spaces as I had clearly mentioned that I need 1 through 5 characters.
I looked at FixedLengthTokenizer source code, it does not seem to trimming it, but I am loosing my spaces in the second and third values, i.e. I am getting "de" and "xy" back.
-
Apr 30th, 2008, 05:43 PM
#2
It's in the FieldSet that the String is getting trimmed. You can use FieldSet#readRawString() to avoid this.
-
Apr 30th, 2008, 08:28 PM
#3
Thanks Lucas! I will try that!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules