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
More information about the Python-list mailing list
Sat Feb 27 11:38:40 EST 2016
- Previous message (by thread): How to remove the line numbers from the file in python
- Next message (by thread): subprocess startup error
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message (by thread): How to remove the line numbers from the file in python
- Next message (by thread): subprocess startup error
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list