Perl rápido e sujo:
perl -MJSON -F, -lane '
print encode_json({
domain => shift @F,
emails => [map {{email => $_, First=>"xyz", Last=>"pqr"}} @F]
})
' file
Ou feio feio awk
awk -F, '{
printf "{\"domain\":\"%s\",\"emails\":[", $1
sep=""
for (i=2; i<=NF; i++) {
printf "%s{\"email\":\"%s\",\"First\":\"xyz\",\"Last\":\"pqr\"}", sep, $i
sep=","
}
print "]}"
}' file