I have a big csv full that looks like so

```
else if(a,b,c,d,e)
else if(a,b,c,d,f)

```

I want to make it look like so

```
else if(a+x==b and b+x==c and c+x==d and d+x==e)
else if(a+x==b and b+x==c and c+x==d and d+x==f)

```

I don't always have 5 variables, some rows have less than that, 5 is maximum, 2 is minimum.

basically remove the commas and add after each variable, `var+x==var2 and var2+x==var3`; making it look like a C++ if statement. Is that doable in sed, awk or perl? I'm mostly interested in awk, for learning purposes, but any solution is good if it works.