Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103591

Re: How to remove the line numbers from the file in python

From Ganesh Pal <ganesh1pal@gmail.com>
Newsgroups comp.lang.python
Subject Re: How to remove the line numbers from the file in python
Date 2016-02-27 22:08 +0530
Message-ID <mailman.180.1456591123.20994.python-list@python.org> (permalink)
References <mailman.145.1456484839.20994.python-list@python.org> <djarckFeuqsU1@mid.individual.net>

Show all headers | View raw


Thanks it works fine :)


On Fri, Feb 26, 2016 at 5:01 PM, Peter Heitzer
<peter.heitzer@rz.uni-regensburg.de> wrote:
> Ganesh Pal <ganesh1pal@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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

How to remove the line numbers from the file in python Ganesh Pal <ganesh1pal@gmail.com> - 2016-02-26 16:37 +0530
  Re: How to remove the line numbers from the file in python "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2016-02-26 11:31 +0000
    Re: How to remove the line numbers from the file in python Ganesh Pal <ganesh1pal@gmail.com> - 2016-02-27 22:08 +0530

csiph-web