can do a sysread and
> change part of a file, but I don't think you can remove part of a file
> without rewriting it.
>
> -Original Message-
> From: Rob Dixon [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 08, 2003 9:20 AM
> To: [EMAIL PROTECTED]
> Subject
"Bob Showalter" <[EMAIL PROTECTED]> wrote in message
2E4528861499D41199D200A0C9B15BC001D7E653@FRISTX">news:2E4528861499D41199D200A0C9B15BC001D7E653@FRISTX...
> Rob Dixon wrote:
> > Hi Bob.
> >
> > "Bob Showalter" <[EMAIL PROTECTED]> wrote in message
> > 2E4528861499D41199D200A0C9B15BC001D7E652@FRI
Rob Dixon wrote:
> Hi Bob.
>
> "Bob Showalter" <[EMAIL PROTECTED]> wrote in message
> 2E4528861499D41199D200A0C9B15BC001D7E652@FRISTX">news:2E4528861499D41199D200A0C9B15BC001D7E652@FRISTX...
> > Rob Dixon wrote:
> > > ...
> > > You're right, I'm wrong, and I hereby resign.
> > >
> > > perl -p
Hi Bob.
"Bob Showalter" <[EMAIL PROTECTED]> wrote in message
2E4528861499D41199D200A0C9B15BC001D7E652@FRISTX">news:2E4528861499D41199D200A0C9B15BC001D7E652@FRISTX...
> Rob Dixon wrote:
> > ...
> > You're right, I'm wrong, and I hereby resign.
> >
> > perl -p -i -e "redo if /^\s*$/" file.ext
>
Rob Dixon wrote:
> ...
> You're right, I'm wrong, and I hereby resign.
>
> perl -p -i -e "redo if /^\s*$/" file.ext
>
> is completely wrong, as the redo doesn't pull in the next line from
> the input. It simply retests the same blank line indefinitely. The
> neater
>
> perl -p -i -e "s/
"David --- Senior Programmer Analyst --- Wgo Wagner"
<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Under w2k I was unable to do an inline update without some type of
> backup. Tried from command line and korn shell. If I did this:
>
> perl -p -i.plsdel -e "s
Nyimi Jose wrote:
>
> > From: Konrad Foerstner [mailto:[EMAIL PROTECTED]]
> >
> > My problem today ;) : I have a file with some unmeant empty
> > lines and I want to remove them, without writing a new file
> > and without storing all the content temporarily in an array.
> > I thought about the fol
Rob Dixon wrote:
>
> Try:
>
> perl -p -i -e "redo if /^\s*$/" file.ext
>
> which will remove all lines consisting only of whitespace.
redo will go back to the top of the loop without evaluating the while
expression so the first blank line will cause an infinite loop.
John
--
use Perl;
pr
l and the two
commands did the change and the cleanup.
A start.
Wags
-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 09:36
To: Timothy Johnson; Rob Dixon; [EMAIL PROTECTED]
Subject: RE: removing emty lines without creating a new file or
Timothy Johnson wrote:
> Except that it will essentially create a new file. Why did you want
> to avoid writing a new file? As far as I know, you can't just
> "erase" data in the middle of a file. That's just not how they work.
> Someone correct me if I'm wrong. As far as I know, any program th
[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 11:25 AM
To: 'Rob Dixon'; [EMAIL PROTECTED]
Subject: RE: removing emty lines without creating a new file or array
Except that it will essentially create a new file. Why did you want to avoid writing
a new file? As far as I know,
similar is that you can do a sysread and
> change part of a file, but I don't think you can remove part of a file
> without rewriting it.
>
> -Original Message-
> From: Rob Dixon [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 08, 2003 9:20 AM
> To:
ry 08, 2003 9:20 AM
To: [EMAIL PROTECTED]
Subject: Re: removing emty lines without creating a new file or array
Hi Konrad
Try:
perl -p -i -e "redo if /^\s*$/" file.ext
which will remove all lines consisting only of whitespace.
Cheers,
Rob
"Konrad Foerstner" <[EMAIL PROTEC
> -Original Message-
> From: Konrad Foerstner [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 08, 2003 5:25 PM
> To: [EMAIL PROTECTED]
> Subject: removing emty lines without creating a new file or array
>
>
> Hi,
>
> My problem today ;) : I have
Hi Konrad
Try:
perl -p -i -e "redo if /^\s*$/" file.ext
which will remove all lines consisting only of whitespace.
Cheers,
Rob
"Konrad Foerstner" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> My problem today ;) : I have a file with some unmea
Hi,
My problem today ;) : I have a file with some unmeant empty lines and I
want to remove them, without writing a new file and without storing all
the content temporarily in an array. I thought about the following lines
of code, but they don't do the job.
open (FH, "+<$filename");
foreach (){
16 matches
Mail list logo