Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Open txt files from directory

mszpot89
9 - Comet

I have a working directory connection but don't know how to open each file in alteryx.

Dynamic input maybe?

 

I will later configure the workflow to pull the data with specific date (201809)

 

image.png

9 REPLIES 9
jdunkerley79
ACE Emeritus
ACE Emeritus

You could use a dynamic input but it is probably easier to use a normal input with wildcards.

 

Put in the path as  \\....\Reports\*201809*.txt and it will read all txt files with 201809 in.

There is an option to include the filename in the output stream.

 

 

mszpot89
9 - Comet

Which I did :D

 

The issue is how to open these files so I can see their content in alteryx.

jdunkerley79
ACE Emeritus
ACE Emeritus

Instead of the Directory tool use an Input tool.

2018-10-22_11-31-44.png

I would suggest reading the text files as CSV with no delimiter, but remember to up the length of lines.

 

Sample of what I mean attached

 

 

mszpot89
9 - Comet

@jdunkerley79 - thank you however that doesn't work yet

 

I would like to the workflow to open the files once enter the directory.

 

image.png

jdunkerley79
ACE Emeritus
ACE Emeritus

Not quite sure I am following.

 

The workflow should read all the contents of the text files into the Alteryx data stream. They won't be parsed into columns, they will just be read as a single column of the lines from the text files

2018-10-22_11-56-27.png

Gets read to:

2018-10-22_11-55-26.png

 

Updated the sample to show how to link a directory to a dynamic input (but the result is identical in this case). 

mszpot89
9 - Comet

@jdunkerley79 - close enough ;)

I used Input tool as well and following error occurs:

 

Warning: Input Data (7): Record #80: Not enough fields in record.

 

jdunkerley79
ACE Emeritus
ACE Emeritus

Have to use dyanamic input and a directory then so you can filter 0 size files.

 

Example attached

mszpot89
9 - Comet

@jdunkerley79 - this is now working !!

 

 

 

 

jdunkerley79
ACE Emeritus
ACE Emeritus

Great - happy to help.

 

Labels