In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Read files from a directory

amrutkasyap
7 - Meteor

Hello,

 

There are about 25 excel files in a directory, each of them have same column names for the first 20 columns. After that some of them have extra columns and its random. How do i remove these extra columns so that all these files have the same structure  

 

For e.g.

 

File 1

Col 1Col 2Col 3Col 4Col 5Extra Col 1

 

File 2

Col 1Col 2Col 3Col 4Col 5Extra Col 1Extra Col 2

 

So from File 1 extra Col 1 needs to be removed

from File 2 extra Col 1 and 2 needs to be removed.

 

Any help is much appreciated 

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @amrutkasyap 

 

Read all the files and columns using the below macro and later deselect the not-required columns in select tool.

 

atcodedog05_0-1646841530039.png

 

Reference post : https://community.alteryx.com/t5/Alteryx-Knowledge-Base/The-Ultimate-Input-Data-Flowchart/ta-p/20480 

 

Hope this helps : )

 

binu_acs
21 - Polaris

@amrutkasyap one option combine all files using a batch macro and remove the unwanted fields using select tool

 

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/The-Ultimate-Input-Data-Flowchart/t...

atcodedog05
22 - Nova
22 - Nova

Hi @amrutkasyap 

 

Glad to hear😀. All of them uses the same method 🙂 you can check through.

 

Happy to help : )

Cheers and have a nice day!

Labels
Top Solution Authors