cancel
Showing results for 
Search instead for 
Did you mean: 

FCC from TXT to XML

0 Kudos

Hello Guys,

I have a scenario where I would need to convert a plain text file with 14 columns into an XML file with only the first and tenth column from the text file.

This XML file would be sent to one receiver.

I also need to send the same text file to another receiver as text file (without any conversion).

I know that the easiest way to get this done is to ,

  1. Use a FCC in Sender channel to convert the 14 Column text file to a 14 column XML file.
  2. Use a Message map to consider only 2 fields out of the 14 fields.
  3. Use one receiver channel to get the XML with 2 fields.
  4. Use second Receiver channel with FCC to reconvert the 14 column XML to 14 Column plain text file.

However, I am trying to avoid any ESR objects and trying the following approach

1. Use a Sender channel without any FCC to poll the 14 Column text file.

2. Send this file directly to First and Second receiver channel

3  Use a MessageTransformationBean in the first to convert the flat file to XML.(SimplePlain2XML)

But the only issue I face here is that I am unable to restrict the XML to have only 2 columns in it. I get all the 14 columns in the XML.

Is there a way to restrict the XML to contain pnly the desired fields during the plain to XML conversion in the module ?

Thanks in Advance,

Senthil

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

This message was moderated.

former_member182455
Active Contributor
0 Kudos

Hi Natarajan,

you can create the 2 interfacess for this case.

1 ) CSV(FCC) to XML - please map the first field and last field in to the target structure

2) with out mapping you need to create the different scenario to send same text file to another folder.

Regards

Srinivas

0 Kudos

hi Srinivas,

Thanks for your help.

But how do you think going for a different scenario would help, as the file would have been already deleted by the first scenario's Sender File Channel?

Regards,

Senthil

former_member182455
Active Contributor
0 Kudos

Hi,

how many files are available for day. trey are placing multiple files or single file for a day.

Regards

Srinivas


0 Kudos

Btw, it is a CSV file and the field lengths are not fixed , hence I am using the field separator as comma to parse the file.