Printing First Three Fields

Hello,

I have several files in the following format:

1*2,3,4,5

And I wish to only print the first three fields, including the special characters '*' and ','. I have used awk to print fields before, but I do not know how to do it to include the delimiters, and how you can do it with delimiters of different types. Any help would be greatly appreciated!

Thank you,

-Jahn

echo "1*2,3,4,5"|cut -d, -f1-3

1*2,3,4
File called "myfile.txt".

1*2,3,4,5
alpha,b*ta,*gamma,delta*,omega


cut -d, -f1-3 myfile.txt

1*2,3,4
alpha,b*ta,*gamma