Re: Fw: Removing double spaces from a file

2003-11-25 Thread Lori
Try one of these: $_=~ s/\s+//sg; $_ =~ s/^\s+//; #Removing leading spaces Nicu Ionita wrote: > > > > while () > > { > > s/\s\s/\ /g; > > print OUT $_; > > } > > > > > > (Assuming IN is an already open filehandle to the source file, and OUT is > one to a destination file.) > > This doesn

Fw: Removing double spaces from a file

2003-11-22 Thread Nicu Ionita
> > while () > { > s/\s\s/\ /g; > print OUT $_; > } > > > (Assuming IN is an already open filehandle to the source file, and OUT is one to a destination file.) This doesn't work. It's better: while () { s/\s{2,}/ /g;# these is a space print OUT $_; } Nicu __