On Mon, Oct 1, 2012 at 3:34 AM, Irfan Sayed wrote:
> hi,
>
> i need to delete all blank lines from the text file
>
>
I usually just skip the blank lines when I read the data one line at a
time. Then you can print to a new file.
My example is below:
#!/usr/bin/perl
use 5.010;
use strict;
use war
thanks a lot !
will improve the coding standard.
regards,
irfan
From: Shlomi Fish
To: Irfan Sayed
Cc: Perl Beginners
Sent: Monday, October 1, 2012 4:08 PM
Subject: Re: delete blank lines from text file
Hi Irfan,
On Mon, 1 Oct 2012 01:34:51 -0700 (PDT
Hi Irfan,
On Mon, 1 Oct 2012 01:34:51 -0700 (PDT)
Irfan Sayed wrote:
> hi,
>
> i need to delete all blank lines from the text file
>
How do you define a blank line? Is it an empty line? Is it a line that contains
only
whitespace?
In any case, here are a few comments on your code and after
Hi,
I can suggest an algo
1) read a file into an array : file -> @array
2) @array = grep defined, @array (this removes all the blank values from an
@array)
3) write array again back to file
kind regards,
Kuldeep
On Mon, Oct 1, 2012 at 2:04 PM, Irfan Sayed wrote:
> hi,
>
> i need to delete all
hi,
i need to delete all blank lines from the text file
wrote following code. however, all the blank lines are not getting deleted.
please suggest
open FILE,"+<", 'C:\Users\bvcontrolbuild\Desktop\test.txt';
while ()
{
chomp;
push (@lines, "$_\n");
}
close F