cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver File Content Conversion

former_member309269
Participant
0 Kudos

Dear All,

I have this scenario: There are 10 fields/columns in the mapping spec out of which we have to send only 3 fields values and rest of the fields we have to send the value as delimiter "|". For eg:

We have the mapping defined for 3,5 and 7th fields (in my message mapping I only have the mapping for these 3 fields, here the field name does not matter as we need to pass the value only). So, now my requirement is to send the output like (in file content conversion we have field separator as ')

|,|,3rdfieldvalue,|,5thfieldvalue,|,7thfieldvalue,|,|,|

So you can see that at 1,2,4,6,8,9 and 10th positions I will need to send |

Can anyone tell me how can I achieve this using File content conversion in FTP receiver channel? As in my mapping, I only have mapping for 3 fields and I need to pass | in rest of the fields, can it be done in communication channel?

Thanks,

Amita

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member309269
Participant
0 Kudos

Any pointers please...

former_member182412
Active Contributor
0 Kudos

Hi Amita,

Map all other fields with constant | in the message mapping then you will got the required output in the file.

Regards,

Praveen.

former_member309269
Participant
0 Kudos

Thanks Praveen for the response.

We don't want to hardcode it in the mapping. Can we do something in communication channel or through file content conversion?

former_member190293
Active Contributor
0 Kudos

Hi Amita!

You can use XSLT transformation with Adapter module "MessageTransformBean" in your receiver channel.

Regards, Evgeniy.

bhavesh_kantilal
Active Contributor
0 Kudos

You can use Parametrized Mapping if you need to avoid any mapping hard codings where you can pass the "|" as a parameter but is that what you need?

Am trying to understand better what other scenarios you have in mind..

former_member309269
Participant
0 Kudos

Thanks Bhavesh for the response.

Whe you say: You can use Parametrized Mapping if you need to avoid any mapping hard codings where you can pass the "|" as a parameter but is that what you need?

Do you mean that I will have to create the field names (all 10 fields names) in the structure. Currently, I have only 3 field names in my mapping (3,5 and 7th field) In rest of the fields, I want to pass |

How can this be achieved that I want to know. Can't we do something in communication channel (we are using FTP receiver channel with content conversion)

former_member190293
Active Contributor
0 Kudos

Hi Amita!

You also can use second XSLT transformation after your first mapping to fill the rest elements with "|" if you don't want to modify your first mapping.

Regards, Evgeniy.

former_member309269
Participant
0 Kudos

Thanks Evgeniy for the response.

The thing is there are around 100 fields (and I need to pass field values only for some of them and for the remaning ones I need to pass |). Do I need to put all the field names in the structure or I can achieve the purpose by only having the field names which have the values?


If you see my scenario just to simply it with 10 fields... in my current mapping, i only have 3 field names. But the target output should be like

|,|,3rdfieldvalue,|,5thfieldvalue,|,7thfieldvalue,|,|,|

How I can achieve the above output?

former_member190293
Active Contributor
0 Kudos

Hi Amita!

Just an idea: if you need to create output file with 100 columns for each row, where you actually have to fill a few of them, you could use java mapping which produces flat file structure and not to use FCC at all.

Regards, Evgeniy.

former_member309269
Participant
0 Kudos

Hi Evgeniy,


Using Java mapping will complicate the things. I think there should be some way to manage in the communication channel itself. 

former_member309269
Participant
0 Kudos

Any pointers please..

bhavesh_kantilal
Active Contributor
0 Kudos

There is no out of the box solution from the File Adapters content conversion for this.

You will either need to define these fields in the DataType/MessageType or use a Custom Mapping technique ( Java / XSLT ) or call a Mapping program from the channel as pointed out by Evgeniy.

Regards,

Bhavesh