Remove leading commas in the file

Hi ,

I have a file with below records

965382,10310858,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
767010,10217614,3,10217616,10217622,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
921586,10303157,9,10522133,10292626,10303161,10378617,10295625,10355684,10296132,10378616,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

How can I remove al the leading commas ?

Thanks,
Vamsi

What do you mean by "leading commas"??

I see lots of trailing commas.

You want to remove exactly what? And replace with what? Nothing?

try this

# sed 's/,\([0-9]\)/\1/g' infile

I believe you mean trailing commas. If so, here's another way:

sed 's/,*$//' infile

My mistake . I mean to say trailing commas .
Thanks Gary . your command sed 's/,*$//' infile is working