# Loading multiple images with a wildcard?

**URL:** <https://discourse.processing.org/t/loading-multiple-images-with-a-wildcard/30866>\
**Category:** Beginners\
**Created:** [June 23, 2021, 9:54am UTC](https://discourse.processing.org/t/loading-multiple-images-with-a-wildcard/30866 "2021-06-23T09:54:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mat100](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mat100](https://discourse.processing.org/u/Mat100)\
**Post date:** [June 23, 2021, 9:54am UTC](https://discourse.processing.org/t/loading-multiple-images-with-a-wildcard/30866/1 "2021-06-23T09:54:17Z")

</div>

Hi,  
How do I load images numbered 0000 - 0100?

I have a series of images "frame-0000.png to “frame-0100.png”  
If I use this code…

```auto
for (int i = 0; i < images.length; i ++ ) {   
 images[i] = loadImage( "frame-000" + i + ".png"); }

```

it will only load images 0-9.

If I it change to…

```auto
for (int i = 0; i < images.length; i ++ ) {  
  images[i] = loadImage( "frame-" + i + ".png"); }

```

it will of course complain there is no image called “frame-0.png” etc

How do I add a wildcard so it looks more like… or let “i” always be a four digit number with leading zeroes?

```auto
for (int i = 0; i < images.length; i ++ ) {
 images[i] = loadImage( "frame-" "*" + i + ".png"); }

```

Many thanks!

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [June 23, 2021, 10:42am UTC](https://discourse.processing.org/t/loading-multiple-images-with-a-wildcard/30866/2 "2021-06-23T10:42:10Z")

</div>

> [@Mat100](#):
>
> always be a four digit number with leading zeroes?

Hello,

One of these should take care of that:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/46f7ae73075ceecc75646b8c6258ff8753078fac.png)

There are resources (tutorials, references, examples) here:

> **[Welcome to Processing!](https://processing.org)**
>
> Processing is a flexible software sketchbook and a language for learning how to code. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology…

`:)`

---

<div class="post-metadata">

**Author:** ![Mat100](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mat100](https://discourse.processing.org/u/Mat100)\
**Post date:** [June 23, 2021, 10:53am UTC](https://discourse.processing.org/t/loading-multiple-images-with-a-wildcard/30866/3 "2021-06-23T10:53:49Z")

</div>

Ah ha, many thanks!  
I had just started watching a first String tutorial on YouTube (Coding Train), and I see the next is called “Split and Join”, so that should be interesting  
I’ve never coded anything before so I’m a bit slow

Many thanks! 🙂

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [June 23, 2021, 10:55am UTC](https://discourse.processing.org/t/loading-multiple-images-with-a-wildcard/30866/4 "2021-06-23T10:55:26Z")

</div>

Hello,

Take a look at one (or all!) of the n\*() ones… used a wildcard there!

`:)`

---

<div class="post-metadata">

**Author:** ![Mat100](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mat100](https://discourse.processing.org/u/Mat100)\
**Post date:** [June 23, 2021, 10:58am UTC](https://discourse.processing.org/t/loading-multiple-images-with-a-wildcard/30866/5 "2021-06-23T10:58:48Z")

</div>

Ha ha, will do! 🙂

> **Summary**
>
> (It seems I have to write at least 20 chars before I can post…)

)

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [June 23, 2021, 11:04am UTC](https://discourse.processing.org/t/loading-multiple-images-with-a-wildcard/30866/6 "2021-06-23T11:04:05Z")

</div>

Hello,

Keep in mind that some of the Processing “helper” functions\methods are there to simplify things.

I used one of the n\*() functions here to clean up the output:  
_[3D Mesh of Sine Waves from Coding Challenge](https://discourse.processing.org/t/3d-mesh-of-sine-waves-from-coding-challenge/22806)_

You can also use Java methods:

> **[Java String format() method - javatpoint](https://www.javatpoint.com/java-string-format)**
>
> Java String format() method with method signature and examples of concat, compare, touppercase, tolowercase, trim, length, equals, split, string format in java etc.

Since you are a beginner progress at your own pace.

`:)`

---

<div class="post-metadata">

**Author:** ![Mat100](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mat100](https://discourse.processing.org/u/Mat100)\
**Post date:** [June 23, 2021, 2:11pm UTC](https://discourse.processing.org/t/loading-multiple-images-with-a-wildcard/30866/7 "2021-06-23T14:11:14Z")

</div>

Ahh, worked a treat!

Thanks for the example for printing the colour values, very helpful.  
And interesting to know you can use Java syntax in addition!

Thanks again! 🙂
