I have an output file in the following format. How can I convert this into csv with first column as header row and second column as data row?
Input:
"Node name","SLAVE_DB" "Node ID","2" "PostgreSQL version","10.17" "Total data size","1 GB" "Conninfo","host=192.168.0.1 port=5432 user=user dbname=postgres" "Role","standby" "WAL archiving","disabled (on standbys "archive_mode" must be set to "always" to be effective)"
Desired Output:
"Node name","Node ID","PostgreSQL version","Total data size","Conninfo","Role","WAL archiving" "SLAVE_DB","2","10.17","1 GB","host=192.168.0.1 port=5432 user=user dbname=postgres","standby","disabled (on standbys ""archive_mode"" must be set to ""always"" to be effective)"
[Edit]
I read through similar questions and I tried awk -F "," '{ for (i=1;i<=NF;i++ ) printf $i ", " }'
but it does not produce the desired output. I also want to preserve the quoted fields with in the data.