Skip to content

Instantly share code, notes, and snippets.

@eisterman
Created May 23, 2023 15:59
Show Gist options
  • Save eisterman/b83a70fe09170e372e10723520f2c9d3 to your computer and use it in GitHub Desktop.
Save eisterman/b83a70fe09170e372e10723520f2c9d3 to your computer and use it in GitHub Desktop.
Versione base del filtro fatto a mano per il piccolo Tia
import csv
with open('input.txt', 'r', encoding='iso-8859-1') as csvfile:
reader = csv.reader(csvfile, delimiter=' ')
with open('output.txt', 'w', newline='', encoding='iso-8859-1') as outfile:
writer = csv.writer(outfile, delimiter=' ')
writer.writerow(next(reader))
for row in reader:
# 1000, 5, 28, 2
if float(row[1]) > 1000 or float(row[2]) > 5 or float(row[3]) > 28 or float(row[4]) > 2:
print(row)
writer.writerow(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment