cancel
Showing results for 
Search instead for 
Did you mean: 

PI Removes ending blank spaces

Former Member
0 Kudos

Hi All,

I searched for this problem on SDN and tried all provided solution.

But it still doesnt work.

I am doing FIX lenght conversion and need blanks at the end of each line to keep the field length equal.

I have given my FCC parameters as

Recordset structure.-- Region

Region.fieldNames BZIRK,BZTXT,BLANK

Region.fieldFixedLengths 5,26,25

Region.fixedLengthTooShortHandling ignore

Region.fieldContentFormatting nothing,nothing,nothing

Region.endSeparator 'nl'

But it still trims all the trailing spacse.

Please help.

Regards,

Nidhi

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Is this issue resolved? I need to have blank spaces at end of each line in a fixed length file. In payload using view source I can see spaces in XML. But when creating text file spaces at the end of each line are truncated.

This is at Receiver file adapter.

Thanks

Former Member
0 Kudos

for debugging u try passing some value into the BLANK field to see if its getting created ..

Former Member
0 Kudos

yes it gets created

problem is only with blank.

Former Member
0 Kudos

yes it gets created

problem is only with blank.

Former Member
0 Kudos

Is this issue resolved? I need to have blank spaces at end of each line in a fixed length file. In payload using view source I can see spaces in XML. But when creating text file spaces at the end of each line are truncated.

This is at Receiver file adapter.

Thanks

Former Member
0 Kudos

Nidhi ,

One option is to set the length in the message mapping for each output field .

Write a udf with 2 parameters as input . One is the value that goes to the output field and other the max length that it should have ...

addSpaces( var, maxLength)

{

String output =var ;

while( var.length()<maxlength)

{

output = output +" ";

}

}

if the length is greater than the maxLength allowed also do a subString in the udf..

Edited by: Rahul Thunoli on May 28, 2010 2:16 AM

Former Member
0 Kudos

Hi Rahul,

Thanks for your reply...

Have a look at my input file thought its a text file m giving you XML so that u can read it better.

So I just want this Blank field to be unaltered.How to acheive this .

<ns0:MT_Region ">

<Region>

<BZIRK>0002</BZIRK>

<BZTXT>Southern region00000 </BZTXT>

<BLANK> </BLANK>

</Region>

<Region>

<BZIRK>NTRE</BZIRK>

<BZTXT>Lower North Island0000000</BZTXT>

<BLANK> </BLANK>

</Region>

</ns0:MT_Region>

Regards,

Nidhi

Former Member
0 Kudos

don't include to the fixedfieldtooshorthandling parameter in the communication channel . And like is aid before set the length for the Blank in the message mapping .. or if you are always going to pass a string of spaces just map a constant with a string of spaces to the field BLANK . Make sure you enter the do fieldFixedlengths in the communication channel .

Former Member
0 Kudos

hi



Region.fieldContentFormatting nothing,nothing,nothing

make it as

Region.fieldContentFormatting nothing

Regards

Ramg

Former Member
0 Kudos

Hi Rahul,

But this will also get trimmed by File Adapter as when I see my mapping payload the spaces are there.

Regards,

Nidhi

Former Member
0 Kudos

Hi Ram,

This also does nt work

former_member200962
Active Contributor
0 Kudos

>

> This also does nt work

How are you viewing the file....some editors wont show you the spaces.

In one the threads it was mentioned that due a space after g in fieldContentFormatting the spaces were not retained....check i something similar (space or other character) is present in your config....also recheck that you have maintained proper names with proper case.

Edited by: abhishek salvi on May 28, 2010 1:50 PM

Former Member
0 Kudos

Hi Abhishek.

I am directly Viewing my output txt file in notepad and there is no space in that.

I have checked all these threads and unfortunatley I have not made any such mistakes