How to format a file in csv format after the first comma in a line?
Based upon the recommendation from @Phillipos:
sed 'h;s/.*,//;s/./,"&"/g;x;G;s/,.*\n/"/;s/^/"/' inp.csv
Explanation:
Divide the pattern space into two parts and operate on them separately then bring them together.
perl -lpe '$_ = q["] . join(q[","], unpack sprintf "A%dx(A)*", index $_, ",") . q["]' inp.csv
Brief Explanation:
° Construct the unpacking format for the input line by finding the location position of the comma, skip the comma from unpack, remaining are unpacked a char each. Then joined with the string ",", finally all enclosed in double quotes.