How to remove the line numbers from the file in python

Ganesh Pal ganesh1pal at gmail.com
Sat Feb 27 11:38:40 EST 2016


Thanks it works fine :)


On Fri, Feb 26, 2016 at 5:01 PM, Peter Heitzer
<peter.heitzer at rz.uni-regensburg.de> wrote:
> Ganesh Pal <ganesh1pal at gmail.com> wrote:
>>what would be the easiest way to remove the lines in the leading
>>numbers 1.e 1 ,2,.... 19  from this file  using python ?
> import sys,re
> for line in sys.stdin:
>         print re.sub('^\d+','',line).rstrip()
>
> --
> https://mail.python.org/mailman/listinfo/python-list


More information about the Python-list mailing list