Awk command

Hi
I have a input file like the below:

V1^a,b
V1^a
V2^b,c
V1^a,b,c
V2^c,d
V3^e,a,f

I want the output file like the below.

V1^a
V1^b
V1^a
V2^b
V2^c
V1^a
V1^b
V1^c
V2^c
V2^d
v3^e
V3^a
V3^f

I want the output file to be shown using awk command .

Regards
Sakthifire

hi,

$ cat inputfile |tr '^' ','|awk -F, 'OFS="^" {if(NF>2) {{print $1,$2}  {print $1,$3} {print $1,$4}} else {print $1,$2}}'|awk -F"^" '{if($2 != "") print }'
V1^a
V1^b
V1^a
V2^b
V2^c
V1^a
V1^b
V1^c
V2^c
V2^d
V3^e
V3^a
V3^f

Thanks
Sha

awk -F^ '{n = split( $2,a,",")
for ( x = 1; x <= n; ++x ) printf "%s^%s\n", $1, a[x]
}' FILENAME

Another approach:

awk 'BEGIN{ FS="[,^]" } { for(i=2;i<=NF;i++) print $1"^"$i }' file

Regards

nawk -F"^" '{
	num=split($2,arr,",")
	for(i=1;i<=num;i++)
		print $1"^"arr
}' filename

Thank you Sha ...
Its working.

Sakthifire