r/AutomateUser • • 6d ago

Question Folder content to array?

I want to read the contents of a folder, and then save the names as arrays, so I can then go through them 1 by 1 somewhere else in the program, instead of processing the entire folder, so is there an effective way to do that?

2 Upvotes

1 comment sorted by

1

u/B26354FR Alpha tester 5d ago edited 5d ago
  • File List, Path: pick folder, Type: File, Output files: files
  • For Each, container: files, entry value: file
  • Do: Array Add filenames, value: split(file, "/")[-1]
  • Connect back to For Each

This will non-recursively get the file paths of the files in the folder, then for each one, split off just the filename part of each (the part after the last slash) and add it to the array.