Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Create a fixed width output using layout file

Naga
8 - Asteroid

Hello,

 

I have below requirement and need to create a output in fixed width text file, which has the given layout for the header field given below. I have similar layout with start position and length of the fields for the detail records.

 

Field #Field NameStart PositionLengthMapping typeValues
1Field 112Hardcode'A'
2Field 235Hardcode'M'
3Field 3830Hardcode'C'
4Field 43830Hardcode'D'
5Field 56810Hardcode'A'
6Field 67820HardcodeB
7Field 7988Insert Current Date
FORMAT: CCYYMMDD
Current date
8Field 8106595Fill-SpaceSpace

 

Thanks

Naga

6 REPLIES 6
markcurry
12 - Quasar

To create a fixed width file, you can use the PadLeft or PadRight functions, see attached workflow, which should hopefully help...

 

 

Naga
8 - Asteroid

Hi @markcurry ,

 

Thanks for the solutions. This I can use for header and footer, however, it will be difficult to manage 100 of fields in detailed record. Any other solution for handling more fields can help.

 

Thanks again for the solution.

 

Thanks
Naga

markcurry
12 - Quasar

Hi @Naga 

 

I've changed the workflow so that you have widths of your fields as an Input, then you can use a single Pad formula, hopefully that works for you...

 

Naga
8 - Asteroid

 

Thanks @markcurry....I am able to achieve with your solution. Thanks again..

markcurry
12 - Quasar

No problem, glad it helped you.  

Bitopi
7 - Meteor

Thanks for this solution, it actually helped me to solve similar kind of problem.

Labels