Thanks But the output is printed on the STDOUT. What if i want to get each of the lines beginning with all: and put in a file or array? How do i do this?
Regards Sudhindra On Wed, 09 Jun 2004 John W. Krahn wrote : >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> > >