Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Read Only Specific fields from Fixed file

cetricelaens
7 - Meteor

Hey Guys, I have an fixed position file as below. From position 1 to 5 some Id, and I have to ignore next 5 characters and position 11 to 15 I have name and again I have to ignore next 5 characters and again I have to read the data. Basically we will accomplish the same in SAS as below

@01 ID $CHAR5.

@11 NAME $CHAR5.

@21 LNAME $CHAR5.  

 

Sample Data

12345XXXXXNAME1XXXXLNAME

54321XXXXXNAME1XXXXLNAME

 

So how to read similarly in Alteryx

3 REPLIES 3
afv2688
16 - Nebula
16 - Nebula

Hello @cetricelaens,

 

If you are reading a txt file you can indeed read fixed delimited width columns:

Sin título.png

 

This should do the trick, if not, you can also use the substring function in the formula tool to achieve it.

 

Regards

echuong1
Alteryx Alumni (Retired)

You can use regex to achieve this! See attached for an example.

 

I essentially set it up to take the first 5 characters, skip 5 characters, take the next 5, skip 4, then the last 5.

 

echuong1_0-1580327494572.png

 

 

RolandSchubert
16 - Nebula
16 - Nebula

Hi @cetricelaens ,

 

you can read the file as a "Fixed Width Text File":

fw1.png

 

You have to select the start of each field visually, fields are created between the selected positions (or last selected position and end of line):

fw2.png

 

Within the visual field editor, you can change the field names (e.g. "ID" instead of "Field_1":

fw3.png

 

To remove the fields you do not need, add a select tool and uncheck the selection for the fields you do not need:

fw4.png

 

I've attached a sample workflow, hope this is helpful.

 

Best,

 

Roland 

Labels