[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: quick scripting question - finding occurrence in many lines

On Monday 06 November 2006 05:29, Steve Lamb wrote:
> Andrew Sackville-West wrote:
> > tr -d '\n'
> >
> > deletes the new lines
>     Ahhh, ok.  Was still going off of the previous Python examples which
> didn't delete newlines, only replaced them with spaces.  Mea Culpa.

Oops again! What I meant to do (and I gather Douglas intended) in the python 
loop was replace the newlines with null strings:

open('IN').read().replace('\n', '').split() 




Reply to: