Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Andy Uttley, Alteryx ACE, makes music with Alteryx | Math + Music

Opening multiple files and then saving them with a field name within the file

7 - Meteor

I am trying to read in about 50 files that all start with the same naming convention "Customer_".


These are CSV files and I would like Alteryx to read in the files and then save them using some fields in the header.



I need to use the first row to determine if it is a detail or a summary, the second line has the file number I want to use to save it, and line five tells me the customer to name it.


I have no need to manipulate the data at all, I just want to rename them all based on the information in the file.


Here is an example of the naming convention "Customer -- Frederick # 10874360 Detail"






ACE Emeritus
ACE Emeritus


I've attached an example of how to solve this.  I tried to include some explanation of what each tool is doing, but if you have questions I will be happy to answer them.

This should work more or less out of the box - you will need to update the Input Data and Output Data tools, replacing \\yourinputpath and \\youroutputpath with the correct input and output locations that you need, but it should otherwise work.

Hope this helps!

7 - Meteor

Hey Claje,


Thank you for that!


At first it only output one file, then I just had to change the "quote output fields" field to auto and it spit out the 4 that I had in that folder.


But when I changed the name in the input to the actual customer it gives me the following error:


Input Data (1) Error reading "C:\Users\Desktop\Attachments from Email\ALDI_inv_0820105926875.csv": Too many fields in record #7


But the files are exactly the same. Any ideas as to what could be causing this error?

7 - Meteor

OK, new problem.


I checked the box to "treat read errors as warnings" and then it produced all of the outputs. But it only outputs the header, all of the details disappear.


Where am I going wrong?

7 - Meteor

I got it working, thank you!!!!!