Currently, I have the below code which finds all the "*_results.csv" files and copies these files to a new directory:
base_dir = r'\temp'
dest_dir = r'\temp1'
for root, dirs, files in os.walk(base_dir):
for filename in [f for f in files if f.endswith("_results.csv")]:
shutil.copy2((os.path.join(root, filename)), dest_dir)
All of these CSV files have 2 columns, but the number of rows varies. All of the CSV files have 2 rows in column A that say "Power" and "Speed", with the values for Power and Speed in column B. It is important to note that "Power" and "Speed" are sometimes in different row numbers within Column A depending on the CSV.
For example --
I am looking to find all the CSV's that have a Power >= -18 or where the Speed - Power >= 5.
Any help would be very appreciated. Thanks.