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.
SOLVED

looping over inputfiles to get fieldnames

Mikis
8 - Asteroid

Hello everyone,

 

Once again a very basic question (sorry).

I have a number of SPSS files for which I want a list of the fields.

Let's say there are 2 files where the first one has field A, B, C and the second has B, D, E then my result would be

filefield
1A
1B
1C
2B
2D
2E

 

I wrote a very simple batch macro for this (cf below & attached). I think it gives a good idea of what I'm trying to achieve.

However, I'm not really sure how to fuel it.

Could someone please give a helping hand?

 

batch.PNG

Thanks,

Mikis

2 REPLIES 2
Claje
14 - Magnetar

Hi,


I attached an updated version of this batch macro here.  Roughly, I think you were super close to what you wanted, but in batch macros, the macro runs once for each line/set of data input.  Therefore, the easiest way to do this would be to use the Input Data tool.

 

Then, you can use this macro with a Directory tool beforehand to pull in all of your files that you want to see info for.

 

Let me know if this helps!

Mikis
8 - Asteroid

@Claje

Thanks, that helped a lot.

I had some issues with updating the fileName because I was apparantly using single quotes instead of double ones and that gave issues with replacing them.

I added the final workflow package for others, thanks a lot for your support!

 

 

Labels
Top Solution Authors