format a string

Hello All,
I have a file which appears as follows

a,alpha,abc-xyz,123
b,beta,prq-jkl,543
c,gamma,xyz-mno,957

I have to extract the entire content, except for the data following "-" in the third column. Output should appear as follows.

a,alpha,abc,123
b,beta,prq,543
c,gamma,xyz,957

Could someone please suggest as to how it can be done?

awk 'BEGIN{FS=OFS=","} {sub(/-.*/, "", $3); print}' data
while IFS=, read -r a b c d; do echo "$a,$b,${c%%-*},$d"; done < data
sed -r 's/-.*(,.*)/\1/g' file.txt > new-file.txt

or to edit the file in-place (without making a new file) use the 'i' flag for sed...

sed -ir 's/-.*(,.*)/\1/g' file.txt