On 7 Sep 2006 at 8:19, Stout, Danny wrote:
> Where "comma.awk" would be the filename of the below script.
>
> =======
{
while (1) {
new = gensub(/(.*[0-9])([0-9]{3})/,"\\1,\\2",1)
if ($0 == new) break
$0 = new
}
print
}
echo hello 12123456 wewr | gawk --re-interval -f commas.awk
hello 12,123,456 wewr
Daniel