I have a glob pattern that i am trying to use to match and pick some file. I am testing it and it seems to only work on the wild card. The example of files is as below which includes other files not listed but a different extension and that I do not need;
240721_124607_1000_Y1_B.txt.bz2
240721_124607_1000_Z1_B.txt.bz2
240721_124607_1000_X1_B.txt.bz2
The glob pattern that i am using gets all the files with the bz2 extension i.e
files = glob.glob('Z:/{}/{}/DL/*.txt.bz2'.format(directory, folder))
The above works but I want to narrow down to get only the ZI files. I have tried the following patterns but they do not work
files = glob.glob('Z:/{}/{}/DL/?Z1.txt.bz2'.format(directory, folder))
and also tried
files = glob.glob('Z:/{}/{}/DL/Z1*.txt.bz2'.format(directory, folder))
and also tried
files = glob.glob('Z:/{}/{}/DL/?Z1*.txt.bz2'.format(directory, folder))
All the above do not work.
*ZI*.txt.bz2? maybe??matches exactly 1 character ... and it looks like there is more than that