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

Alteryx Designer Desktop Discussions

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

Text (.txt) file Non-Delimited - Flat File Layout

wottel
8 - Asteroid

I have a text file that I need to separate into about 250 columns. There are no delimiters that exist. (see pic below)

Text File example.png

 

Is there a way to establish the field names/lengths outside of manually setting the field divisions and naming each field? I see the "Use Field Settings from File" option, but can't locate any instructions/examples on how that is used.

 

Ideally, I'd like to create a file with the field name and lengths and then use those values to parse the txt file.

5 REPLIES 5
MarqueeCrew
20 - Arcturus
20 - Arcturus

I've used this technique in the past:

 

open your file and create 2 or 3 fields.

 

Save you file as a FLAT

 

Open the FLAT and you'll see the XML that you need.

 

Create a formula that concatenates all of the data together based upon a table of fields and lengths.

 

Update your xml and save.  When you open the flat file, use the .FLAT as the metadata.

 

Done.

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
wottel
8 - Asteroid

Thanks so much Marquee.. that saved me a ton of time and tedious work..

UnknownUser
7 - Meteor

Is it possible to provide the Alteryx workflow for this? 

wottel
8 - Asteroid

Attached is a sample flat file that i edit in notepad to change the field names and field lengths.. 

 

the way it works is you open the "flat file" in notepad and set your field names and lengths(sample below)

Capture.JPG

 

 once finished, save the file..then from Alteryx, setup your input for the text file you need to parse, and when prompted choose to import as a "flat file"

 

Then, when you get to the screen below, select "Use Field settings.. " option. Select the folder icon to the right and then choose the "flat file" that you updated from above as your template. 

 

 

Capture2.JPG

 

Once you select your file, Alteryx will use the field names and lengths to parse your source file. (see below)

Capture3.JPG

 

Hope that helps.. 

brendafos
10 - Fireball

I do not see an attached example file. 
This would be helpful.

 

Labels
Top Solution Authors