Printing Field with Delimiter in AWK/cut

Hello,

I had posted earlier about printing fields using AWK, but now I have a slightly different problem. I have text files in the format:

1*2,3,4,5

and wish to print the first, third, and fifth fields, including the asterisk and commas. In other words, after filtering it should look like this:

1*3,5

I know how to print the fields using AWK, sed, or cut, but do not know how to deal with printing fields with different delimiters, nor how to include those in the output. Any advice is much appreciated!

Thank you,

-Jahn

well....not the cleanest solution, but if your file is all in samew format as noted you could rebuild output like this:

#  echo "1*2,3,4,5" | nawk -F"[*,]" '{print $1"*"$3","$5}'
1*3,5

HTH