Map issue with Positional schema

I have a requirement where the incoming message is a .csv file

80000073,2,,05/14/2012,2153.91
80000073,3,,05/25/2012,184.56
80000073,40,,07/20/2012,1911.69
80000073,500,,07/26/2012,4437.71

I have to convert it into a text file

80000073         00000000550080814000000482782

80000073         00000359460022814000000000102

80000073         00000359470022814000000001427

80000073         00000364540052314000000001700

They are positional

I have to intend with the space in the first filed which i can do with the the String function. But I am not sure how can I do with the second field to add zeros in front of the fields. Because the length of the 2nd field in output is 10. So if the incoming is 2 the output should be 0000000002, if it is 200 then 0000000200. I am not sure how to add those zeros in front.

Thanks

July 31st, 2015 11:30am

In the Mapper, use an inline C# Scripting Functoid.

You can use the String.PadLeft method to get exactly what you want.

http://msdn.microsoft.com/en-us/library/system.string.padleft.aspx

Refer for other ideas: left padding in biztalk map he

July 31st, 2015 12:16pm

For clarity, you will need two different Schemas, one to parse the csv and one to emit the positional.

In the positional schema, you don't need to pad anything yourself, the Flat File Assembler will do that automatically.  Meaning, you don't need to use the String Function for anything.

For the second Field, just change the Pad Character to '0'.  The default is the ' ' (single space).

Pad Character: https://msdn.microsoft.com/en-us/library/aa559352.aspx?f=255&MSPPError=-2147217396

July 31st, 2015 9:59pm

Hi,

You don't need to have scripting Functoid for this :). As been correctly pointed out by boat seller it can be done with having schema for parsing and then removing the positional value .

There are couple of MSDN article which can help you

https://msdn.microsoft.com/en-us/library/ee254462%28v=bts.10%29.aspx

http://www.codeproject.com/Articles/13259/Flattening-out-the-complexity-in-flat-file-schem

Thanks

Abhishek

Free Windows Admin Tool Kit Click here and download it now
August 1st, 2015 1:50am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics