File list length

Hi, I am wondering if anyone could help me with getFilelist. I am using it to generate list of files and it works kind of but doesn’t print all the names it goes only to certain point. I have around 41,000 files and when trying to produce list from those it just pulls maybe like 92. So to try to troubleshoot I tried it on 432 files and it only makes list of 396. So I am wondering if there is some kind of length limit on list or I am doing something wrong.

Justyna

Hi @Justyna_Cholewa-Wacl

I’m not aware of any length limit. Can you post a minimal working example of the code that is causing problems? You might also try replicating your workflow using the ListFilesRecursively example script and see if you get the same thing.

A last question is whether you have any non-standard characters in your file names, as this might (?) affect your results.

Thanks.

Hi,

this is the code I am using:

inDir=getDirectory("Choose the input folder"); 
myList=getFileList(inDir);

the file names are example: r01c01f56p01-ch2sk1fk1fl1

If I have only 220 files in folder it produces correct array of 220 file names.

Thank you!

Best wishes,

Justyna

Hi, I will try ListFilesRecursively. Thanks!

Justyna

These are the same two commands in the linked example, so they should give the same results.

The only other thing I can think is to check further down in your script that you’re not changing your iteration variable within the loop (do you have nested loops both using the same variable?) as this could shorten your initial loop length. Just a thought.

2 Likes