This would be much easier if you were to do the semicolon-to-comma replacement
before the csv table conversion.
Then you could build up a new table row by row, column by column,
and do the reverse csv table conversion in one shot,
before doing reverse coma->semicolon replacement in one shot,
then write it all out.
I attached a sample I used with another semicolon lover.
Also, your column limit should be length of list(row), not 12.
That would be more bulletproof.