kavitha thankaian wrote:
> hi,
>    
>   i have a file which has the contents as follows:
>    
>   a,b,c,d,
>   a1,b1,c1,d1,
>   a2,b2,c2,d2,
>    
>   i would like to delete all the trailing commas,,
>    
>   if someoneknows pls help me,,
>    
>   kavitha
......

I often use sed for such small problems.

c:\tmp>cat ex.txt
a,b,c,d,
a1,b1,c1,d1,
a2,b2,c2,d2,

c:\tmp>sed -e"s/,$//" ex.txt
a,b,c,d
a1,b1,c1,d1
a2,b2,c2,d2

c:\tmp>

that doesn't involve python of course. I recommend one of the many tutorial 
introductions to python if the problem requires its use.
-- 
Robin Becker

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to