> I applied David's suggestion with \mysep, and it seems to work, only
> it produces a space before the comma rather than after it as it should be...
It would produce a space after the comma if you used `\gdef\mysep{, }`
and as I mentioned you may need to input ignoring end of line eg
{\endlinechar=-1\input{zzzz}}