Getting a list of file names from a zip file
The [highlight txt=’get file list from zip file’] instruction allows a user to extract a list of the names of all the files contained within a zip file into an Excel worksheet. The instruction can be configured to generate the list of names in either ascending or descending order.[message type=”warning”]For the purposes of this article we are going to use two simple and fictitious Excel files. They have already been uploaded into a data step. You will want to replace these files with those of your own.[/message]
Before we get started
Please further create a ‘Manipulate a file’ or ‘Multiple file manipulations’ action step so that you can add and use instructions.
The source file that we are going to use contains the following 4 files as viewed from Windows Explorer:
The target file that we are going to use is a standard fresh Excel workbook which contains 3 empty worksheets.
1. Create a ‘Get file list from zip file’ instruction.
2. Link the file named “Source” as the source file.
3. The rule for ‘File list sort order’ should be set to Ascending by default.
4. Link the file named “Target” as the target file.
5. Use Sheet1 from the target file.
6. Use cell A1 from Sheet1.
7. Save and run the step.
8. After the step finishes running, download and open the target file. It will resemble the image below: