Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Peter Heitzer" Newsgroups: comp.lang.python Subject: Re: How to remove the line numbers from the file in python Date: 26 Feb 2016 11:31:32 GMT Lines: 7 Message-ID: References: X-Trace: individual.net 8JiR0uBxv6u9lLHmK5RIjwVJB3ljDa75VCksvKPOFDh0lZVb6IS+0x6jP3 X-Orig-Path: not-for-mail Cancel-Lock: sha1:c/XjHqHrXfNeqoxzzt4UKESBNtE= User-Agent: tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (Linux/3.16.0-4-amd64 (x86_64)) Xref: csiph.com comp.lang.python:103536 Ganesh Pal 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()