What kind of files can I import if I am importing multiple .csv files from a folder into one input data tool? I have different kinds of files. Some of them have different numbers of rows/columns from the template file while the field names are also different from the template in some of these files.
Solved! Go to Solution.
Hi @mishail_iqbal, using the *.csv approach within the Input tool will bring-in multiple csv files as long as they have the same column names (there is no restriction to the number of rows that can be brought in). If you are looking to read multiple csv files which have different number of columns or the column names change across multiple files, you will need to create a macro to bring-in the data. The key element within the macro is to setup the following config:
I hope this helps and answers your question.
Thank you so much for helping me out! Just to clarify, if I import using the wild card and don't apply the macro, then only the files where the number of rows is different will be imported, while the files with different column names and different number of columns will not be imported. Is that correct?
@mishail_iqbal if you are doing it in one Input Data tool, it is expecting the files to have the same schema which means that the column names will be the same and the data types in each column will be the same.
Here is a great article that explains all of the different ways that you can bring files into Alteryx: https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/The-Ultimate-Input-Data-Flowchart/t...
Hi @mishail_iqbal ,
As a leader in the Alteryx Community, I have the ability to identify & mark accepted solutions on behalf of community members - and recently did so on this thread. If you have any questions or concerns with the solution(s) I selected please let me know by replying to this post.
To answer your follow up question - yes, different schemas will error when using wildcards. the field names and types need to be the exact same with wildcard. the macro will union by name (or position - depending on your setup).
As the original author, you also have the ability to mark replies as solutions! Going forward, I’d encourage you to identify the solution or solutions that helped you solve your problem, as it's a big help to other community members. Learn more about Accepted Solutions here.
Thank you!
Can this be done w the excel files?
Can you provide an example of how to do with a WILDCARD plx
Do you have specific excel files with the same naming convention in a folder?
Example:
Folder Path: C:\Folder\Predictive\Workflows\Files\Name#.xlsx
File names:
Name_1.xlsx
Name_2.xlsx
Name_3.xlsx
The input folder path would be C:\Folder\Predictive\Workflows\Files\Name_*.xlsx
Here is another guide: https://www.thedataschool.co.uk/borja-leiva/4840
Hope this helps. If it does please like the post.