IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Line feed at end of flat file Options · View
alexndr
Posted: Friday, November 9, 2018 2:35:25 PM
Rank: Newbie

Joined: 11/8/2018
Posts: 7
I'm using a flat file as output for one of my mappings.

At the end of the target file, on the last line with data, I get an undesired line feed. How is this avoided?

Thanks.

K101
Posted: Tuesday, November 13, 2018 2:10:27 PM
Rank: Advanced Member

Joined: 2/27/2009
Posts: 565
It depends. You probably have some fixed-length split which is putting in a line feed. It may or may not be possible to replace it with a floating split. Or, you can post-process the whole FlexText output as a string and truncate it to length() − 1.
alexndr
Posted: Wednesday, November 14, 2018 7:59:22 AM
Rank: Newbie

Joined: 11/8/2018
Posts: 7
I have been in contact with support and according to them the line feed is expected with my setup (it's configured as a repeatable split, "delimited (lined based)" ). I agree with that but problem is that the receiver of the file sets the rules and they don't want a line feed on the last line in the file.

Support also suggested the solution with truncation to length() − 1. Problem is that I want to generate Java code from mapping and it seems to not support post- processing?

K101
Posted: Wednesday, November 14, 2018 11:37:48 AM
Rank: Advanced Member

Joined: 2/27/2009
Posts: 565
There's no limitation against "post-processing" using Java in general.
alexndr
Posted: Friday, November 16, 2018 12:45:03 PM
Rank: Newbie

Joined: 11/8/2018
Posts: 7
Is that so? Maybe we're talking about different types of post processing.

The solution I tried was to serialize the target and manipulate it using a substring function.
Error when generating Java code was:
serialize (xxxx): Structures which parse or serialize strings are not supported for Java.

If MapForce have other means for post- processing can you please guide me to it? I can't find anything.

Of course it's solvable by modifying the generated Java code but what happens when we adjust the MapForce- mapping for some reason and have to re- generate the code? Chance that we miss to manually re- add the extra post- processing in code is big.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.