Skip to Content
0

Extra newline in the flat file sent as an email attachment

Oct 12, 2017 at 12:37 PM

72

avatar image
Former Member

Hello All,

We have a scenario where proxy message is sent as an email attachment to the end user. The file is in text format and we are using MessageTranformBean in the receiver channel. In the end of the file, we are getting two extra newline. The end user confirmed that they are unable to upload the files with these extra newlines.

Scenarion: Proxy -> PO -> Flat file (going to FTP server & as mail attachment)

Please suggest how to remove these extra newline from the file.

Note: We are currently using PO 7.31 single stack SP 18.

Snaphot of the file:

Parameter used in the Receiver Mail Channel:

Thanks,

Bobby

capture-1.jpg (38.1 kB)
capture-2.jpg (58.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Manoj K Oct 12, 2017 at 03:39 PM
0

Hi Bobby,

Yes this is know issue .Here is one of the approach create 2 Structure Header and Trailer . So lets say you have 'n' no of records coming from proxy so under Header populate n-1 records and for the trailer populate the last nth record.

Now in Module Define Header.fieldSeparator/endSeparator as '\n' or 'nl' and don't define any separator for Trailer by doing this you wont be adding an extra line at the end of the file.

Br,

Manoj

Show 4 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Manoj,

Thanks for your suggestion. But what if the scenario is pass through? Please refer to the proxy structure I have used and no mapping involved.

How can I handle the issue here?

Thanks,

Bobby

capture3.jpg (20.8 kB)
0

Have u tried this

0
Former Member

Hello Manoj,

Your first solution did not work. We are still getting the extra newlines.

Thanks,

Bobby

0

Can you please share the XML after mapping and the MTB configuration.

0
Evgeniy Kolmakov Oct 13, 2017 at 11:34 AM
0

Hi Bobby!

Did you try to use 'nl' as field separator? And did you check that your proxy message didn't contain empty 'Line' elements?

Regards, Evgeniy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hello Evgeniy,

There is no empty 'Line' in the proxy message. And we have already tried 'nl' as a separator but still getting the extra newlines.

Thanks,

Bobby.

0