Directory - Multiple unique file iterative read/process, then Consolidate
- 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
I have a directory containing 25 LARGE (record limit 1 required) files (All with different schema). I am attempting to perform a Field View (Or metadata) on each file, and then export that information into an excel file. Now... I understand I could do this manually. But I should be able to automate this by using the Directory, and have a workflow cycle through each file, and then post each files information in a different tab within the same excel workbook (OR Union the data, because metadata columns are similar while the underlying datasets might not be).
I was able to use
to perform a field view on the grouped data, but unfortunately it started showing the source as 'File: (Multiple Sources)' which is not useful at all. I would rather have the duplicate rows showing the different sources.
I imagine an iterative macro would be needed here.
Solved! Go to Solution.
- Labels:
- Iterative Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@PeteLacz based on your request, it appears this may resolve your issue.
If you read in all the files from your directory and then feed them through a Dynamic Input tool followed by a Field Info tool, you should be able to get the field info for each file in the directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks porter_samu,
Unfortunately the dynamic input function won't play well when reading in different files with different schema. Also, I am specifically trying to read in SAS7BDAT files. So sheets won't be a consideration. I played around with the workflow and modified it for those files, but dynamic input wasn't having it. That said, I believe the solution has been found below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you Echuong!
I had to insert a formula function between the directory and the two macros you grouped into one to specify the file path. It worked! I allowed me to pool in all the field info data for each file and stack them with the redundancies I was looking for. I also modified it for SAS7BDAT files.
You showed me I was close to the answer on my own, but it didn't occur to me group the macros like you did. Thanks again.
