cancel
Showing results for 
Search instead for 
Did you mean: 

Extra Blank Line gets added at the Beginning of the file by File Adapter...

Former Member
0 Kudos

Hello All,

I have created an RFC to File Adapter scenario in PI 7,1 and I am using Content Conversion in the File Adapter to convert the payload structure to flat text file. The input Structure is simple as follows:

<File>

<FName>some file name</Fname>

<Record>

<Data>

<Line>Text Lines</Line>

</Date>

</Record>

</File>

while using the following Content Conversion Parameters: While I have defined "Record" as Structure.

Record.addHeaderLine = 0

Record.fieldSeparator = 'nl'

Record.endSeparator = 'nl'

Here everything is working fine except that the text file getting generated has a blank line at the beginning. I was thinking that by adding "Record.addHeaderLine = 0" parameter, no header line will be added to the file but this seems to be not working. I tried to include the top element "File" with the same parameters and different combinations but was not able to achieve the result and it stopped the file creation altogether.

So, I'll appreciate if anyone can suggest something to get rid of the this blank line at the beginning of the file.

Regards,

Athar

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Extra blank line is actually provided for the FNAME node, but not displayed because of it has different structure with Record node.

Change the structure for FNAME to :

<FName>

<Data>

<Line>some file name</Line>

</Data

</Fname>

this way "some file name" will be dispalyed in the text file at the first line of file. To remove it use this trick, define the following values in Content Conversion Parameters:

in the Recordset Structure : FName,Record

FName.fieldFixedLengths = 0

FName.fixedLengthTooShortHandling = Cut

FNamee.fieldSeparator = '0'

FName.endSeparator = '0'

Record.fieldSeparator = 'nl'

Record.endSeparator = 'nl'

Rgds,

Triana

Former Member
0 Kudos

Hi,

Do you want to use the field and record separators as same i.e newline 'nl'....??

Try give field separator as , and record separator as 'nl' and by removing first parameter...addhearderline =0..

HTH

Rajesh

former_member207622
Contributor
0 Kudos

Can you try and use Document offset =1 in receiver file adapter

thanks

Ninad

Former Member
0 Kudos

Hi Rajesh,

Thanks for your input, however I cannot use ',' as the field separator because of the following two reasons:

1) This file is to be stored to a separate server in the original form without any extra character, as it forms the input for some other third party software, so if use comma(,) as the field separator then it will produce a file with commas in between the message content.

2) The second reason is that I need every record to produce a new line in the file, where as "Record.endSeparator ='nl' " is not having any effect, if I put " Record.fieldSeparator = , " then it produces a file with commas between records and in a continues line.

Regards,

Athar

Former Member
0 Kudos

Hi Ninad,

Thanks for the suggestion, however Document Offset parameter is only valid for the Sender File Adapter but in my Case I am creating an RFC to File Adapter scenario where I am having a Receiver File Adapter which does not have any Document Offset Option.

Regards,

Athar

Former Member
0 Kudos

Have you tried to remove parameter Record.addHeaderLine = 0 ?

Former Member
0 Kudos

Yes, I have tried with removing this parameter as well but still no luck.....