I have two CSV files
input.csv:
id,scenario,data1,data2,result
1,s1,300,400,"{s1,not added}"
2,s2,500,101,"{s2 added}"
3,s3,600,202,
output.csv
id,result
1,"{s1,added}"
3,"{s3,added}"
I want to combine this two CSVs using Shell/Python scripting such that the output is as follows:
final_output.csv
id,scenario,data1,data2,result
1,s1,300,400,"{s1,added}"
2,s2,500,101,"{s2 added}"
3,s3,600,202,"{s3,added}"
Conditions: 1. column to join both csv is "id" column
- result column data if present in output.csv then override the value. If it is not present then keep as it is
Can you please help?