Tags: line, mailtopython-gt, message-gt, numbers, org, original, program, programming, python, python-list-bouncesjr94453datt, todaysummary, tool

Looking for a Python Program/Tool That Will Add Line Numbers to

On Programmer » Python

991 words with 0 Comments; publish: Fri, 02 May 2008 01:44:00 GMT; (20066.41, « »)

> --Original Message--

> From: python-list-bounces+jr9445=3Datt.com.python.todaysummary.com.python.org [mailto:python-

> list-bounces+jr9445=3Datt.com.python.todaysummary.com.python.org] On Behalf Of William Pursell

> Sent: Monday, February 18, 2008 8:37 AM

> To: python-list.python.todaysummary.com.python.org

> Subject: Re: Looking for a Python Program/Tool That Will Add Line

> Numbers to atxt File

>=20

> On Feb 14, 6:54 am, "W. Watson" <wolf_tra....python.todaysummary.com.invalid.com> wrote:

> I need

> field

> source on

has

> burst

>=20

> Not sure if "Python program/tool" means "a tool or a program

> in Python", but if awk is okay, that's the tool I would use:

>=20

> awk '{printf( "%4d %s\n", NR % 10000, $0 )}'

On a related note, since it's probably easier to install Perl instead of

awk on a windows box:

type foo.java | perl -ne "$counter++; print sprintf(qq(%4d ), $counter),

$_;"

All Comments

Leave a comment...

  • 0 Comments