a potentially huge json-lines file with objects of known structure is to be converted to csv with headers. example {"name":"name_0","value_a":"value_a_0","value_b":"val_b_0"} {"name":"name_1","value_a":"value_a_1","value_b":"val_b_1"} {"name":"name_2","value_a":"value_a_2","value_b":"val_b_2"} {"name":"name_3","value_a":"value_a_3","value_b":"val_b_3"} {"name":"name_4","value_a":"value_a_4","value_b":"val_b_4"} expected output "name","value_a","value_b" "name_0","value_a_0","val_b_0" "name_1","value_a_1","val_b_1" "name_2","value_a_2","val_b_2" "name_3","value_a_3","val_b_3" "name_4","value_a_4","val_b_4" currently tried (if (input_line_number == 1 ) then…