This is one file result.csv
:
M11251TH1230
M11543TH4292
M11435TDS144
This is another file sample.csv
:
M11435TDS144,STB#1,Router#1
M11543TH4292,STB#2,Router#1
M11509TD9937,STB#3,Router#1
M11543TH4258,STB#4,Router#1
Can I write a Python program to compare both the files and if line in result.csv
matches with the first word in the line in sample.csv
, then append 1 else append 0 at every line in sample.csv
?