Conversion Skript für stündliche Werte aus csv

This commit is contained in:
Patrick Hangl
2024-12-19 15:26:43 +01:00
parent f248d74dbe
commit abe1c9d83d
2 changed files with 8778 additions and 0 deletions

18
conversion.py Normal file
View File

@@ -0,0 +1,18 @@
import csv
def process_csv(input_file, output_file):
n = -2
with open(input_file, mode='r', newline='') as infile:
reader = csv.reader(infile)
with open(output_file, mode='w', newline='') as outfile:
writer = csv.writer(outfile)
for row in reader:
n = n + 1
if n==4:
writer.writerow(row)
n = 0
# Beispielhafte Verwendung
input_file = 'Lastprofil_SWBT.csv'
output_file = 'Lastprofil_final_H0.csv'
process_csv(input_file, output_file)