Padding zeros after removing commas in file

Hi Gurus,

          There is a ASCII file in which a comma is used as a seperator for the amount field when the amount exceed seven digits: e.g. 0001300,000. Now, this comma needs to be removed from this field, after padding leading zeros \(to maintain the ASCII positions\) e.g. 00001300000. Could anyone post a detailed solution which can handle this requirement?. There are multiple records in the file which fall under this category.

Thanks for your help

Prakash

This is gnu sed....

$ echo "0001300,000" | sed -r 's/([0-9]{7}),([0-9]{3})/0\1\2/'
00001300000