Skip to Content
Author's profile photo Former Member

File Content Conversion for Unequal Number of Columns

Now consider this scenario, the input flat file is in the following format.Vector[] vectorItem = new Vector ;


for(int intCounter =0; intCounter < arrayItemset.length; intCounter++) {

     StringTokenizer st = new StringTokenizer (arrayItemset[intCounter],”,”);

     vectorItem[intCounter] = new Vector(20);


     while (st.hasMoreTokens())

          vectorItem[intCounter].addElement (st.nextToken());




for(int intVectorCounter = 0; intVectorCounter < vectorItem.length; intVectorCounter++ )

     for(int intCounter = 0; intCounter < vectorItem .capacity(); intCounter++)

          result.addValue((String) vectorItem .get(intCounter));               

Finally create the Interface Mapping also.


In the Configuration part, both the Sender and Receiver Communication
channels will use File adapter.


In the Sender Communication channel, we have to choose the
Message Protocol as File Content Conversion and also fill the Content
Conversion Parameters as shown in the following picture.



And also add the following columns in the Content Conversion Parameters. These columns are sufficient to do this conversion.



Then do the remaining Confiuration part for executing this scenario.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Sravya Talanki
      Sravya Talanki
      You could have set the context of ITEMSET to CT_INPUT_MSG and used split by value and mapped to ITEM.That solves the problem and indeed simple way of doing it.
      Author's profile photo Former Member
      Former Member
      Interesting approach !!

      Even though doing the mapping using user defined functions looks intresting, like Sravya mentioned its much simpler to user split by value instead "No Brainer"


      Author's profile photo Former Member
      Former Member
          Thanks for your idea. I did it in a complex way.