Alteryx Designer Desktop Discussions

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

Read text delimited based on column name

PRAM
6 - Meteoroid

Hi,

 

I have a downloaded multiple text files from SAP that has no clear delimiter or field length. I would like to split the file based on the column header that is on the 2nd row. Please can someone help ?

PRAM_0-1653548064707.png

 

14 REPLIES 14
Ladarthure
14 - Magnetar
14 - Magnetar

Hi @PRAM,

 

if you mean using a kind of visual layout of the file. You can do with the input tool.

 

Connect to your file (let's suppose it is a csv). Then you can change the format to flat ascii (.flat) and finally set a file/field layout in the options.

 

tell me if it works for you!

PRAM
6 - Meteoroid

Hi,

 

Thanks for your quick help on this.  Apologies if I misunderstood your solution. I would need the (40) files to be automatically split and not visually split them every time. I would need the files to be split into columns based on when a new field name starts as each of the files is coming up with different field length for each of those fields.

 

I am hoping to go from this

 

PRAM_0-1653550244174.png

 

 

to

 

PRAM_1-1653550292576.png

 

 

Eventually the goal is to combine all these text files in to one excel file with the columns split correctly

Ladarthure
14 - Magnetar
14 - Magnetar

Could you share a sample of the file to give it a try?

PRAM
6 - Meteoroid

Attached sample file. Thank you

Ladarthure
14 - Magnetar
14 - Magnetar

I did it with the fixed width, it worked fine for me. What I did was drop the file on the canva, the specify it's a fixed width file. Then there is a popup to specify each field length, to do this, just click in the top part to have it specified. This done, you should now be able to prep your file properly. (I only did on one of your files)

PRAM
6 - Meteoroid

ok thank you - On a brief look, it looked like the file didn;t have fixed length for each field. Is there a way to achieve this in case the field is not fixed width? In case it varies depending on value

PRAM
6 - Meteoroid

PRAM_0-1653554764825.pngPRAM_1-1653554784302.png

 

Here you can see how the field length varies for each of the file

 

Ladarthure
14 - Magnetar
14 - Magnetar

If you don't have any separator or fixed width per column, it will be "manual", it will depend a lot on the file and your abilioty to identify something or a method to split :)

PRAM
6 - Meteoroid

:( I was hoping that the method would be when the top row has these descriptions like Material  Vendor etc that it could break a column. Because that is what I would do manually. Is there no way to do it?

Labels