Announcement Announcement Module
Collapse
No announcement yet.
Writing to a fixed length file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Writing to a fixed length file

    Hello,

    This posting is a continuation of my previous one about 'Reading and writing a fixed length file'. I was running the multilineJob where the output file is created according to the multilineJob.xml -
    Code:
    <bean id="writer" class="org.springframework.batch.item.file.FlatFileItemWriter">
    		<!-- <property name="resource" value="file:target/test-outputs/20070122.testStream.multilineStep.txt" />-->
    		<property name="resource" value="file:target/test-outputs/20090917.testStream.multilineStep.txt" />
    		<property name="lineAggregator">
    			<bean class="org.springframework.batch.item.file.transform.PassThroughLineAggregator"/>
    		</property>
    	</bean>
    The content of the output file -
    Code:
    [Trade: [isin=UK21341EAH45,quantity=978,price=98.34,customer=customer1], Trade: [isin=UK21341EAH46,quantity=112,price=18.12,customer=customer2]]
    [Trade: [isin=UK21341EAH47,quantity=245,price=12.78,customer=customer2], Trade: [isin=UK21341EAH48,quantity=108,price=9.25,customer=customer3], Trade: [isin=UK21341EAH49,quantity=854,price=23.39,customer=customer4]]
    Wondering what would I need to change under <bean id="writer" of the xml to create only the values in the same fixed length format of the input file?

    Thanks
Working...
X