I am trying to sort some simulation files with the extension .sim. At the moment I have the following code:
import os
import re
files = [f for f in os.listdir('.') if re.match(r'.*\.sim', f)]
print(files)
When I run the code I get these results:
['Yunlin_Shorepull_South_Current_1.8_Wind_0.sim',
'Yunlin_Shorepull_South_Current_1.8_Wind_0_Relocated.sim',
'Yunlin_Shorepull_South_Current_1.8_Wind_1.sim',
'Yunlin_Shorepull_South_Current_1.8_Wind_10.sim',
'Yunlin_Shorepull_South_Current_1.8_Wind_10_Relocated.sim',
'Yunlin_Shorepull_South_Current_1.8_Wind_11.sim', ...]