awk -F"," '{ if ($1 == "solar/string") {print "{asset_id:\" "$2,"\", \"pitch\":20, \"anchors\": { \"points\": [{\"lat\":" $7,",\lon\":" $8, ", \"alt\": 0 },{\"lat\":" $10,",\"lon\":" $11",\"alt\":0 }]}, \"asset_definition\":{\"panel_size\":{\"height\": 1.35, \"width\": 5 }}}," >"newfile.txt"}}' testfile.txt