How to transfer data from file to file?

Question:

source data output.csv :

"   Open Time   Close time  Open    Close   High    Low Volume  STATUS  CLINE_TYPE  FIGURE_TYPE EXTREMUM    CORIDOR_PRICE_STATE Intersections   LEVEL   START_TIME_FIGURE   END_TIME_FIGURE Open_Max_FIG    Open_Min_FIG    Close_Max_FIG   Close_Min_FIG   Price_Max_COR   Price_Min_COR   High_Max_FIG    High_Min_FIG    Low_Max_FIG Low_Min_FIG High_Max_COR    Low_Min_COR ACTION"
"0  2022-08-28 09:35:00+03:00   2022-08-28 09:39:59.999000064+03:00 20021.24    20025.68    20036.99    20015.0 285.1567    COMPLETED   Decrease    nan                                                                         "
"1  2022-08-28 09:40:00+03:00   2022-08-28 09:44:59.999000064+03:00 20025.68    20029.56    20038.32    20023.85    224.01732   COMPLETED   nan nan                                                                         "

result work code
receiver data receiver.csv :

O,p,e,n, ,T,i,m,e
C,l,o,s,e, ,t,i,m,e
O,p,e,n
C,l,o,s,e
H,i,g,h

please tell me where is the error in the code?

import csv
filepath_source = "C:\Users\pyth\output.csv"
filepath_receiver="C:\Users\pyth\receiver.csv"

file_write = open(filepath_receiver,'w+', newline ='')

with open(filepath_source) as r:
    write = csv.writer(file_write)
    data = csv.reader(r, delimiter='t')
    for row in list(data)[0:2]:
        write.writerows(row)
file_write.close()

Answers:

import csv
filepath_source = "C:\Users\pyth\output.csv"
filepath_receiver="C:\Users\pyth\receiver.csv"

with open(filepath_receiver, 'w') as response_file:
    with open(filepath_source) as f:
        reader = csv.reader(f)
        next(reader, None)
        data_source = set(f.readlines())
    for line in data_source:
        a=line.strip().split('t')[0]
        if int(a)==100:
            response_file.write(line)
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.