ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Create a fixed width output using layout file

Naga
アステロイド

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

7件の返信7
markcurry
クエーサー

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

 

 

Naga
アステロイド

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
クエーサー

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
アステロイド

 

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

markcurry
クエーサー

No problem, glad it helped you.  

Bitopi
メテオール

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

SKHENRY
アトム

5 years later this answer just saved my bacon thank you markcurry

ラベル
トップのソリューション投稿者