Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Fix Length Flat File

scott_tonjes
6 - Meteoroid

I have a need to create a fixed length flat file with a requirement for different lines to have different lengths, e.g. the Header row is length 100 and the detail row is length 150. The output tool always writes a file with all lines the same length, the longest length.

 

Does anyone know a way to solve this problem?

7 REPLIES 7
MarqueeCrew
20 - Arcturus
20 - Arcturus

If you read your flat file in as a csv with \0 as the delimiter maybe you can trim the first record and create a csv with \0 as a delimiter. 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
scott_tonjes
6 - Meteoroid

I'm not reading a file. I'm trying to write to a file

scott_tonjes
6 - Meteoroid

It looks like that will work

ryno1145
5 - Atom

I have a similar need, to export data in a fixed field .txt format with specified lengths for each column:

 

Field_Name

Length

Field_Type

FIRST NAME

32

CHARACTER

MIDDLE NAME

32

CHARACTER

LAST NAME

32

CHARACTER

ADDRESS LINE 1

38

CHARACTER

ADDRESS LINE 2

28

CHARACTER

CITY

15

CHARACTER

STATE

2

CHARACTER

ZIP CODE

9

CHARACTER

SSN

9

CHARACTER

DOB

10

CHARACTER

Subcode

8

CHARACTER

Unique_ID

8

CHARACTER

Portfolio_ID

2

CHARACTER

 

What's the best way to accomplish this?

iracine
7 - Meteor

I tried everything and thankfully found your response.

Worked like a charm! Thanks for sharing @MarqueeCrew 

MarqueeCrew
20 - Arcturus
20 - Arcturus

@iracine  Does that make me charming?

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
iracine
7 - Meteor

It indeed does! 💪

Labels