Importing Multiple Files and File Types
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Is it possible to simultaneously import multiple files from a folder that are either Excel, text, or CSV files? I've created batch macros to read in all Excel files or all CSV files, etc., but was wondering if there is a solution to bring them all in at once without separate inputs, then a Union tool.
Please let me know if you need any clarification or have any questions.
Thanks in advance!
Solved! Go to Solution.
- Labels:
- Batch Macro
- Input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
YES. You need to build a second action tool from your control panel which parses out the file type (.xlsx or .csv) and modified the file-format parameter in your input data for the proper config (25 for .xlsx, 0 for .csv - if memory serves me.)...
Take a look at some solutions here:
https://community.alteryx.com/t5/Weekly-Challenge/Challenge-180-Thousand-File-Challenge/td-p/461356
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for your reply. One final question - Is there a configuration for a pipe-delimited text file? I see tab and CSV on the lists, but no pipe-delimited and the macro will not read in my pipe-delimited text files.
Thanks for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
| delimited is the same format as .csv with a different delimiter. toggle the delimiter to | (or \| if needed) in the input data tool. tab delimited is \t.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm using a Directory tool with a Batch Macro to read in 24 files. 12 are Excel files and 12 are pipe-delimited text files. Currently, my Batch Macro has 2 Control Parameters - one to update the the Full Path and the other to update the File Types. It did not read in the pipe-delimited text files. Is there a work around on the macro to allow for the macro to read them in? Or do I need to do 2 separate inputs and union them? Attached is a screenshot of my workflow.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@kaca226_ Hi, good day!
I have also multiple file types (.xlsm, .xls, .xlsb, and .xlsx) and sheets that I want to read it once in the Alteryx. Can I ask, what did you do in your Batch Macro with 2 control parameters? I am not very familiar with the tool. Hoping for your response.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Tating22,
For the macro to work correctly, you need to tell it to update for each file in your directory and also update for the type of file, hence the two control parameters.
Here is a Challenge Alteryx posted that utilizes a macro in this manner:
https://community.alteryx.com/t5/Weekly-Challenge/Challenge-180-Thousand-File-Challenge/td-p/461356
I have also attached a sample workflow from @David-Carnes that shows how it should be set up. You can view the macro he used within the workflow.
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Glad I could help, lol.
![](/skins/images/12A9B4B958288E867BE947DD48612FB8/responsive_peak/images/icon_anonymous_message.png)