diff --git a/launch_parser_on_nidm.py b/launch_parser_on_nidm.py index 5981f889f..8596dbfc2 100755 --- a/launch_parser_on_nidm.py +++ b/launch_parser_on_nidm.py @@ -81,8 +81,8 @@ def main(): context_write.write("Processing files...\n") # Iteration on each example - for root, _, files in os.walk(opt.input_dir): - for file in files: + for root, _, files in sorted(os.walk(opt.input_dir)): + for file in sorted(files): if file.endswith("batch.m"): # spm filename_ss_ext = file.split(".m")[0]