View Full Version : Transformation Strategy
vijaynairis
Sep 12th, 2007, 12:01 AM
Hi,
I got a huge file which has got data in the client specific format....I need to convert it into our own specific format....I would like to know if Batch comes in built with some specific transformation routines....
e.g. A in file X to be converted into B which is my format
Thanks...Vijay
lucasward
Sep 13th, 2007, 11:15 AM
I wouldn't call them specific 'transformation routines', however, we do support parsing flat files in a pluggable manner using something we call 'tokenizers'. For example, there are currently two main Tokenizers: Delimited, and FixedLength. (both are in the org.springframework.batch.io.file.support.transfor m package) In the case of delimited you can define the delimiter (comma, pipe, etc) that will be used to separate elements. The FixedLengthTokenizer, requires that you pass it the field lengths that define each individual element. In your scenario, a developer would simply configure a tokenizer for the client specific format to read in.
When it comes to reading out, there is an opposite interface: LineAggregator, which would need to be configured to for your in house format.
I would highly recommend that you look at some of the sample jobs for details into how these are used. TradeJob would be a good example.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.