I want to create sub folders

Asked by Md about 11 hours ago
Latest activity Commented on by Image Analyst about 2 hours ago

I have 1000 frames in a folder. I want to create 10 sub folders and want to store 100 frames in each sub folder.

3 Comments

Md about 7 hours ago

I also want to move frames from parent folder to the subfolders

Matt Kindig about 7 hours ago
doc copyfile
Md about 6 hours ago

Thanks for your answer. But I want to move first 100 frames in folder 1, and then second 100 frames in folder 2 and so on. Can you please tell me how I can do that?

Md

Tags

Products

No products are associated with this question.

2 Answers

Answer by Image Analyst about 11 hours ago
Accepted answer
mkdir('Frames 1 to 100');
mkdir('Frames 101 to 200');
mkdir('Frames 201 to 300');
mkdir('Frames 301 to 400');
mkdir('Frames 401 to 500');
mkdir('Frames 501 to 600');
mkdir('Frames 601 to 700');
mkdir('Frames 701 to 800');
mkdir('Frames 801 to 900');
mkdir('Frames 901 to 1000');

2 Comments

Md about 10 hours ago

Thanks for your answer. image names are like Img0001.tif, Img0002.tif ...... upto Img1000.tif and my parent folder directory is C:\Users\aftab\Desktop\New folder

Now can you please explain me how I can write a code using mkdir Thanks a lot for your answer.

Image Analyst about 2 hours ago
mkdir('C:\Users\aftab\Desktop\New folder\Frames 1 to 100');
mkdir('C:\Users\aftab\Desktop\New folder\Frames 101 to 200');
mkdir('C:\Users\aftab\Desktop\New folder\Frames 201 to 300');
mkdir('C:\Users\aftab\Desktop\New folder\Frames 301 to 400');
mkdir('C:\Users\aftab\Desktop\New folder\Frames 401 to 500');
mkdir('C:\Users\aftab\Desktop\New folder\Frames 501 to 600');
mkdir('C:\Users\aftab\Desktop\New folder\Frames 601 to 700');
mkdir('C:\Users\aftab\Desktop\New folder\Frames 701 to 800');
mkdir('C:\Users\aftab\Desktop\New folder\Frames 801 to 900');
mkdir('C:\Users\aftab\Desktop\New folder\Frames 901 to 1000');

You can use sprintf() to build up a string if you want. But since there's only 10 of them, it's easiest just to call mkdir 10 times rather than fool with a look and sprintf, as long as you have a known 1000 frames. If the number of frames could be variable, then construct a loop.

Image Analyst
Answer by Sean de Wolski about 11 hours ago
doc mkdir

?

0 Comments

Sean de Wolski

Contact us