Sudhindra K S wrote:
> 
> Hi

Hello,

> I am new to perl and getting confused with pattern matching.
> 
> How do i remove blank files from a file. For ex: i have a file as below
> 
> abc
> xyz
> 
> def
> 
> 123
> 
> Now i want to remove all blank lines and have an output as below
> abc
> xyz
> def
> 123
> 
> How do i do this?

perl -i~ -ne'/\S/&&print' yourfile.txt


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to