Insert commas in a table/array

I have a table, of the form

\documentclass[hyper,12pt,A4paper]{article}
\usepackage{latexsym,amsmath,amsfonts,amssymb}
\begin{document}
\begin{align}
\begin{array}{cccc}
ab=0 & cd=1 & efgh=-1 & pqr=30
\end{array}
\end{align}
\end{document}


but of course, with many many more rows and columns. The output of this looks like this:

But instead, I would like to put commas between successive entries, to make it look something like this:

(with no comma after the last entry in a particular row). Of course, this is trivial to do by hand if there are only a few entries in the table. But I have about 50 such tables and each has a dimension of 5x5 or more. These tables were generated as output from some Mathematica code which is even harder to retrospectively modify.

So my question is: is there a way to modify the \begin{array}{cccc}...\end{array} to something which is schematically like \begin{array}{c,c,c,c}...\end{array} (which in this form is wrong -- I know!)?

• why do you have an array here these are equations not matrices so the array layer is not needed (and makes it harder to get good output) – David Carlisle Dec 13 '18 at 9:00
• the answer to the question as asked is \begin{array}{c@{,}c@{,}c@{,}c} but I suspect it is the wrong question. – David Carlisle Dec 13 '18 at 9:02

A rather easy solution would be, to define your own separator, like \def\sep{\unskip, &} and using this in your tables instead of the & sign (the \unskip removes the spaces before the ,). With this, you could just going once through all your tables and replace the & sign with your defined command.