Please help us to help you; post what code you've already got, so we'll know where you're stuck.
While we're at it, be sure to let us know if it's safe to assume that it will always be the first five fields that need a comma placed after them, and never any more or less than five.