[plug] Re: perl program to strip blank lines from a file
David Buddrige
buddrige at wasp.net.au
Mon May 17 16:49:57 WST 2004
matching "^\r\n$" does the trick [in perl]. thanks heaps guys! 8-)
David.
Ryan writes:
> On Mon, 2004-05-17 at 15:36, David Buddrige wrote:
>> Hi all,
>>
>> I am tryin to put together a program which will strip blank lines out of a
>> text file. To this end, I have written the following perl program; but it
>> doesn't seem to work... can anyone see why? To my mind, the regex ^$ should
>> match lines that have no content, but this does not seem to be so...
>
> If they have no content, they will contain at the very least a new line
> character. hexdump -c on the file will show you the escape characters
> at the appropriate spots. It may be a simple \n or \r\n for DOS files
> (from memory).
>
> Ryan
>
> _______________________________________________
> PLUG discussion list: plug at plug.linux.org.au
> http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au
More information about the plug
mailing list