ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

looping over inputfiles to get fieldnames

Mikis
アステロイド

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件の返信2
Claje
マグネター

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
アステロイド

@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!

 

 

ラベル
トップのソリューション投稿者