Re: removing emty lines without creating a new file or array

2003-01-08 Thread R. Joseph Newton
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

Re: removing emty lines without creating a new file or array

2003-01-08 Thread Rob Dixon
"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

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Bob Showalter
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

Re: removing emty lines without creating a new file or array

2003-01-08 Thread Rob Dixon
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 >

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Bob Showalter
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/

Re: removing emty lines without creating a new file or array

2003-01-08 Thread Rob Dixon
"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

Re: removing emty lines without creating a new file or array

2003-01-08 Thread John W. Krahn
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

Re: removing emty lines without creating a new file or array

2003-01-08 Thread John W. Krahn
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

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
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

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Bob Showalter
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

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Dan Muey
[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,

Re: removing emty lines without creating a new file or array

2003-01-08 Thread Rob Dixon
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:

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Timothy Johnson
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

RE: removing emty lines without creating a new file or array

2003-01-08 Thread NYIMI Jose (BMB)
> -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

Re: removing emty lines without creating a new file or array

2003-01-08 Thread Rob Dixon
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

removing emty lines without creating a new file or array

2003-01-08 Thread Konrad Foerstner
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 (){