apologies in advance if there is already a solution for this somewhere, I was not able to find it.
I have several numbered folders in a directory, each of them have a file "U.txt" that I would like to run a script on. So my file structures are like:
folder -0 --U.txt -10 --U.txt ... -250 --U.txt
I want to recursively go into each folder. I am aware you can do this with
glob, I so I can get past that part, I'm just unsure of how to save them all into one file, with their file names numbered. So I want to save the new U.txt, (which will be a .npy file), into a new folder like
U_0.npy U_10.npy ... U_250.npy