# Feature request: add nth as option to selectImage command

**URL:** <https://forums.unrealengine.com/t/feature-request-add-nth-as-option-to-selectimage-command/1882319>\
**Category:** Feedback & Requests\
**Tags:** Console, command, console-commands, realityscan\
**Created:** [May 31, 2024, 11:01am UTC](https://forums.unrealengine.com/t/feature-request-add-nth-as-option-to-selectimage-command/1882319 "2024-05-31T11:01:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oleg\_Postoev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oleg\_Postoev](https://forums.unrealengine.com/u/Oleg_Postoev)\
**Post date:** [May 31, 2024, 11:01am UTC](https://forums.unrealengine.com/t/feature-request-add-nth-as-option-to-selectimage-command/1882319/1 "2024-05-31T11:01:05Z")

</div>

Add the nth to this command:

```auto
selectImage	imagePath|regexp

```

For example, I want to select every 4th input. Do it manually in the project with 20k inputs is to horrify =(

---

<div class="post-metadata">

**Author:** ![OndrejTrhan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ondrejtrhan/32/906565_2.png) [@OndrejTrhan](https://forums.unrealengine.com/u/OndrejTrhan)\
**Post date:** [May 31, 2024, 11:59am UTC](https://forums.unrealengine.com/t/feature-request-add-nth-as-option-to-selectimage-command/1882319/2 "2024-05-31T11:59:21Z")

</div>

Hi Oleg,  
you can use this script for this: [RealityCapture CLI Sample Scripts - Capturing Reality](https://www.capturingreality.com/realitycapture-cli-sample-scripts#:~:text=Examples%20of%20how%20to%20select%20images%20using%20regular%20expressions)  
Don’t need to do it manually.

---

<div class="post-metadata">

**Author:** ![Oleg\_Postoev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oleg\_Postoev](https://forums.unrealengine.com/u/Oleg_Postoev)\
**Post date:** [June 2, 2024, 10:59am UTC](https://forums.unrealengine.com/t/feature-request-add-nth-as-option-to-selectimage-command/1882319/3 "2024-06-02T10:59:47Z")

</div>

Really thank you! It’s really useful materials

If someone need the same feature, here is a way how I completed it:

1. Export image list of my project into `images.lst`
2. Create a file `4th.py` in the folder with `images.lst` with content:

```py
with open('images.lst', 'r') as infile:
    inputs = infile.readlines()

selected_inputs = [inputs[i].strip() for i in range(0, len(inputs), 4)]

with open('select_every_fourth.rccmd', 'w') as outfile:
    for img in selected_inputs:
        outfile.write(f'-selectImage "{img}" union\n')

```

1. Run this python script.
2. After successful running there will be a `select_every_fourth.rccmd` in same folder, drag-n-drop it into Reality Capture with opened project.
3. Wait when it will be done. For example, I waited selection of 4500 images about 30-40 seconds.

---

<div class="post-metadata">

**Author:** ![Oleg\_Postoev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oleg\_Postoev](https://forums.unrealengine.com/u/Oleg_Postoev)\
**Post date:** [June 2, 2024, 1:14pm UTC](https://forums.unrealengine.com/t/feature-request-add-nth-as-option-to-selectimage-command/1882319/4 "2024-06-02T13:14:52Z")

</div>

How could I found this page ([RealityCapture CLI Sample Scripts - Capturing Reality](https://www.capturingreality.com/realitycapture-cli-sample-scripts)) in the navigation? Which section contain links like these?  
UPD: sorry, I finally found it at the end of this page [Sample datasets - Capturing Reality](https://www.capturingreality.com/sample-datasets)
