perl -pe ‘s/;\s*/;/g; s/(\d+)=(.*);/_$1=”$2″, /; s/\n//g;’ pspc_ms-pt_from_carbon.tmpl | perl -pe “s/\”/’/g”
In this solution, I break the task into two steps connected by pipe — more manageable.
- First step inserts double-quotes;
- Second step transforms all double quotes to single quotes.
I didn’t find a cleaner alternative.