cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion CSV File

Former Member
0 Kudos

Hello All,

I have a CSV file in the below format.

a,b,c

And my content conversion works.

<1>a</1>

<2>b</2>

<3>c</3>

Sometimes I get the records in the file as

a,b,

My conversion is failing, I mean it give me file as

<1>a</1>

<2>b</2>

The last element <3></3> is not getting created.

I tried to use lastFieldsOptional its not working.

How can I achieve this.

Regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi SriHari ,

Please check with your CC parameters . Make sure that you have mentioned endSeperatot and fieldSeperator properly. If you have your structure repeating make sure that you have mentioned endSeparator

Regards

Former Member
0 Kudos

Hello Kulkarni,

I have given endSeparator 'nl'.

Regards,

Former Member
0 Kudos

Hello,

Anybody can help me on this?

Regards,

Former Member
0 Kudos

Sri Hari,

If you always get your source file as a,b,c then it will work fine. If you get as a,b it will not work because it doesnot match to the requirements. Since you said it is csv file then you should get the file as a,b,

So please check this. Also put the parameter lastfieldoptional to YES. Then it should work. Also can you tell us what you have specified in your content conversion parameters?

---Satish

Former Member
0 Kudos

Hi...

Try to test this map using test tool in IR. Give blank in all fields and then test and post the result...

Regards,

Gourav

Former Member
0 Kudos

Hello Satish,

I am getting the record as a,b,c or a,b, only.

And this is the content conversion I am doing.

Data.fieldSeparator ;

Data.fieldNames Dest_Plant,Product,WZone,WBin

Data.processFieldNames fromConfiguration

Data.lastFieldsOptional Yes

Data.missingLastFields Add

Data.additionalLastFields ignore

Regards,

Former Member
0 Kudos

Hello Gourav,

It gives me executed successfully.

Regards,

Former Member
0 Kudos

Bandi,

You have given 4 fields in your fieldNames. Then how come you are having only three values. It should a,b,c,d or a,b,, So please check.

Also the .lastFieldsOptional parameter should be <b>YES</b> instead of Yes. So please change this and give a try once again.

---Satish

Former Member
0 Kudos

Okay I have mentioned it as a example,

I am getting the records as

either a,b,c,d or a,b,c,

and it fails for a,b,c,

not taking the last null value.

And I have changed yes to Uppercase.

Regards,

Former Member
0 Kudos

Bandi,

Go to adapter monitoring and tell us what error you are getting?

---Satish

Former Member
0 Kudos

Satish,

Its giving a success message.

My conversion was never failing only thing is it unable to create the last empty tag if the value is not available.

Regards,

Former Member
0 Kudos

Bandi,

I am not understanding what you are trying to achieve? If the file is read and came into XI then what you are missing?

Also you use exists funciton in mapping. If it exists just map it up else if you want you can send the constant.

---Satish

Former Member
0 Kudos

Okay Satish I will give a last try to explain you my issue..

my CSV file is like this a,b,c,d

my conversion works fine so the xml is after conversion

<1>a</1>

<2>b</2>

<3>c</3>

<4>d</4>

Now few rows in the file may come as a,b,c, there is no d value it is blank.

so I expect the conversion to be now

<1>a</1>

<2>b</2>

<3>c</3>

<4></4>

like this, but what I am getting now is after conversion...

<1>a</1>

<2>b</2>

<3>c</3>

tag <4></4> is not getting created and my Outbound expects the XML to be in that format, so for this I tried to use lastfieldsoptional so that empty <4></4> tag is created but no luck...

This is what I want to do..

In the process even though <4></4> is not created File Content Conversion is successful and so Adapter Monitoring is showing success and my mapping fails.

Regards,

Former Member
0 Kudos

Bandi,

Can you please use if-then in your mapping for this field. It should be like this:

If>Field>Exists

Then-->Feild

Esle-->Constant

Then I think you should be fine.

---Satish

Former Member
0 Kudos

Hello Satish,

Excellent I was missing this. I was always wondering why it is not converting and checking the limitations of FCC.

Again I didnot concentrate on the problem area MAPPING.

Thanks for your support and time.

Regards,

SriHari Bandi.

Former Member
0 Kudos

Its my pleasure Bandi. Good to know your issue is solved.

---Satish

Answers (3)

Answers (3)

vuyyurujyothi
Participant
0 Kudos

Hi SriHari,

Try to use fieldFixedLengths, if possible. I think it will work.

Why you need that empty field? for mapping or for other purpose?

If it is for mapping, you can check node existence before mapping the value.

If node does not exists, you can map constant to target field.

Please mention what you will do with that field, so that we can achieve that requirement in different way, if it is not possible with FCC.

Thanks,

Jyoths.

Former Member
0 Kudos

Hi,

Try to test it with 'space' in last field.

Regards,

Gourav

Former Member
0 Kudos

Hello Gourav,

I didnt get you when you say space where should I give space.

Regards,

Former Member
0 Kudos

Hi,

First check it in mapping , have seen in mapping the last field,

if you have in mapping,then check it in the FCC parameters

fieldnames are given correctly or not??

Regards

Chilla

Former Member
0 Kudos

Hello Chandra,

Names are correct and everything works fine when I get the complete record. But when I donot have the last entry in the record row then its not creating the null element.

when record is

a,b,c then its creating xml

<1>a</1>

<2>b</2>

<3>c</3>

but when the record is a,b, instead then it is creating the xml as

<1>a</1>

<2>b</2>

I want it to be created as

<1>a</1>

<2>b</2>

<3> </3>

Regards,

Message was edited by:

SriHari Bandi