Try this:
open(INFILE,"myfile.txt");
open(OUTFILE,"SSlines.txt");
while(<INFILE>){
unless($_ eq "\n"){ #blank lines probably have only a \n
print OUTFILE $_;
}
}
-----Original Message-----
From: Brian Volk [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 1:48 PM
To: [EMAIL PROTECTED]
Subject: delete blank lines from a file?
Hi All,
I'm new to perl, so this may seem really basic, so any hints or
directions to help files would be greatly appreciated. :-)
I written a script that fetches a file from my web server (LWP::Simple
and Net::FTP::Common both work) and loads it into mysql. (DBI) That
part works great! The problem I'm having is the file in loading into
mysql is double spaced. How can I go about deleting the blank lines
before I load it into mysql?
Thanks!
Brian
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------------------
This email may contain confidential and privileged
material for the sole use of the intended recipient.
If you are not the intended recipient, please contact
the sender and delete all copies.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]