18 lines
554 B
Python
18 lines
554 B
Python
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) |