#replace
sed -i '/SERVER_NAME/ s/$/-Dusername=convert&/' a.txt
#rows to cols
cat a.txt| sed ":a;N;s/\\n/,/g;ta"