Alteryx Designer Desktop Discussions

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

Parsing data

olimpio
8 - Asteroid

Hi Everyone,

 

I have a question about parsing data from a .txt file. The data fields are all separated by huge spaces

 

any thoughts of how i can go about this task

 

 

 

2 REPLIES 2
ImadZidan
12 - Quasar

Hello @olimpio ,

 

It depends on the situation of this file and things like:

 

Is this an one-off input? In this case , there is flexibility . Start with the input tool. See how it is parsed by default, may be followed by a cleansing tool with different option etc.

Is this recurrent input? In this case, you need to understand these huge spaces

      are they tabs?

      are they just many spaces

      are they?

      and in this case, structured cleanup is necessary keeping in mind the files that will follow will have the same structure.

 

I am sure other contributors will ads to this.

 

If you have a sample, lets explore.

 

Hope this helps.

 

echuong1
Alteryx Alumni (Retired)

A couple of ways I would approach this. I would start off by importing everything as data, including the header.

 

I suggest using a data cleansing to remove duplicate spaces, and then a text to columns to split the value based on the space. A select will remove the original field, and a dynamic rename will bump the headers up.

 

Another method is to use a regex to replace instances of one or more spaces with a single delimiter, like a pipe. That can be used in the text to columns.

 

Hope this helps!

 

echuong1_0-1614359792136.png

 

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels