Conversion Skript für stündliche Werte aus csv
This commit is contained in:
8760
Lastprofil_final_H0.csv
Normal file
8760
Lastprofil_final_H0.csv
Normal file
File diff suppressed because it is too large
Load Diff
18
conversion.py
Normal file
18
conversion.py
Normal 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)
|
||||||
Reference in New Issue
Block a user