# Looking in Folders and Building Arrays of contents on program startup

**URL:** <https://discourse.processing.org/t/looking-in-folders-and-building-arrays-of-contents-on-program-startup/21902>\
**Category:** Coding Questions\
**Created:** [June 15, 2020, 11:34pm UTC](https://discourse.processing.org/t/looking-in-folders-and-building-arrays-of-contents-on-program-startup/21902 "2020-06-15T23:34:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eyetoof](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@Eyetoof](https://discourse.processing.org/u/Eyetoof)\
**Post date:** [June 15, 2020, 11:34pm UTC](https://discourse.processing.org/t/looking-in-folders-and-building-arrays-of-contents-on-program-startup/21902/1 "2020-06-15T23:34:48Z")

</div>

Hello,

I Have been reviewing this page on listing the contents of directories and sub directories  
[Processing Directory List](https://processing.org/examples/directorylist.html)

My question now is how to work with this data effectively once gathered. I say “effectively” because most of the documentation about parsing strings I have seen seem to be about working with big data files. I just imagine what I am trying do must be pretty common, and already well solved. I have just not been able to find any good examples.

My plan is to have a folder inside data, with more folders inside that of my art files. Some will be still images, some will be frames of animation. I plan to make a folder per animation with the relevant frames inside. So my directory structure may be something like:  
…data/Art/Stills  
…data/Art/Anims/Cow  
…data/Art/Anims/Car  
…data/Art/Anims/Worm  
…etc.

So “Stills” would a folder of images that should be loaded into one Array.

the Anim folders should have their contents loaded into an Array each.

For testing purposes I have been hardcoding my arrays. All that is working just fine. I would like to be able to freely drop new content in these folders and have everything be loaded when I run the program.

Thanks in advance for any help or direction you can provide.

Toof

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [June 17, 2020, 1:02am UTC](https://discourse.processing.org/t/looking-in-folders-and-building-arrays-of-contents-on-program-startup/21902/2 "2020-06-17T01:02:43Z")

</div>

If you do not find a post in the Processing forum that suits your need, you can try stackoverflow. What you are trying to do is related to Java and not strictly to Processing. In other words, whatever solution you find in pure Java world, you can use it directly in Processing. For example, check [this](https://stackoverflow.com/questions/1844688/how-to-read-all-files-in-a-folder-from-java).

You will need to get each file’s full path, parse the folder structure and manage the files based on their path. This can be done easily based on the description that you provided above. Good luck!

Kf
