Alteryx designer Discussions

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

File from directoy

Highlighted
Meteor

Hello all,

I am trying to automate a solution that currently uses a excel macro to parse the data once I go and pick the file.  What I want to do is have my workflow automatically grab the file each day.  It sounds easy but here is the trick the file name changes everyday.  Here is an example of the format:  me305010_j60785_20170809.prn the underlined and bold part will always be the day before or on weekends it will be the past Friday.  I appreciate any insight.

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@bvolles,

 

One approach that you can use is a DIRECTORY tool to read all of the .prn files that are in the directory.  Upon successful completion of your job, you can write/update a file that contains all of the processed named files.  The Directory tool can join on the filename to the processed file table and allow only NEW files to be read into a DYNAMIC Input tool.

 

Regardless of the name structure, this approach will read and process new files.  You can also include date logic in the process if you should so choose.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Highlighted
Meteor

How would I actually read the prn file?  The directory tool just returned all prn files.

 

PS I am a beginner so take it easy on me :)

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Can you post a sample file for us?

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Highlighted
Meteor

Here is some sample data...I took out personal information.  Also to note that these prn files are not in a folder on the network drive and there are several other prn files as well.  The files I am interested in will always begin with me305010_j223

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@bvolles,

 

Capture.png

 

  1. The DIRECTORY tool is going to read a list of all files that begin with "me3050101_j223".
  2. The INPUT tool is going to read your list of "PROCESSED" Files.
  3. The JOIN tool is going to find the files that have not yet been processed and push them out the L anchor to a Dynamic Input tool.
  4. The DYNAMIC INPUT tool is going to read a template and use a .CSV format (but use the ~ as the delimiter) to parse the data.
  5. The UNION is going to update the file list and send the directory of "PROCESSED" Files downstream to ultimately overwrite the original File listings.

I hope that this helps.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Highlighted
Meteor
Thank you for your assistance!
Highlighted
Meteor

@MarqueeCrew  either I am being really dense or I missed something.  what do I pull in the second input?

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner
It is a chicken and egg thing. The first time that you run, it isn't there. After the first execution it is sourced from the bottom outta it file.
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Highlighted
Meteor

I was able to run it this time.  Its not grabbing the most recent file however?

 

Labels