Hi Konrad Try:
perl -p -i -e "redo if /^\s*$/" file.ext which will remove all lines consisting only of whitespace. Cheers, Rob "Konrad Foerstner" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > My problem today ;) : I have a file with some unmeant empty lines and I > want to remove them, without writing a new file and without storing all > the content temporarily in an array. I thought about the following lines > of code, but they don't do the job. > > > open (FH, "+<$filename"); > > foreach (<FH>){ > $_ =~ s/^\n//g; > } > > > What's wrong? > > Konrad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]