I have a directory of dat files named in the following manor:

```
4sl_shear11_scale0.dat,
-8_shear1_scale5.dat,
-18sl_shear0_scale2.dat,
...

```

I want to add a conditional statement based on the file name, specifically `shear_n`. The condition would go something like this?

```
if shear_n > 20:
    do the thing 
elif shear_n < 10:
    do the other thing
else:
    do nothing 

```

Usually I would go of index of the file name but the index of shear number changes due to - and sl.
What would be the most robust approach to do this?