I have the following string
y10_zcis y10_nom y10_infl y20_zcis y20_infl y30_zcis I would like to transform this to
"y10_zcis", "y10_nom", "y10_infl", "y20_zcis", "y20_infl", "y30_zcis" I accomplished something similar with the extremely ugly:
$ cat in.txt | sed 's/ /\'$'\n/g' | sed 's/\(.*\)/"\1",/g' | tr -d '\n' "y10_zcis","y10_nom","y10_infl","y20_zcis","y20_infl","y30_zcis", But that feels like an utter failure, and it doesn't take care of the last unwanted , (but perhaps this is best to just delete afterwards)