Re: REGEXP removing - il- - -b-f and - il- - - - f
- From: daggerquill@xxxxxxxxx (Jay Savage)
- Date: Wed, 27 Apr 2005 11:28:49 -0400
On 4/27/05, Ing. Branislav Gerzo <konfera@xxxxxx> wrote:
> Jay Savage [JS], on Wednesday, April 27, 2005 at 10:26 (-0400)
> thoughtfully wrote the following:
>
> JS> If all you want is the last column, this is a really long way to go about it.
> JS> while (<V4>) {
> JS> print (split)[7];
> JS> print "\n";
> JS> }
>
> (split)[-1] is better, not ?
>
That depends on where you think you're data is going to get corrupted.
If you think something might throw a space in the middle of one of
the the other colums (e.g. "s g F01010"), (split)[-1] will work
better. On the other hand, if you think your input may contain
something like this at you:
6 2005/02/28 22:47 180 100% -il-o-b----- sg F01005 !error:
you need to grab (split)[7]. For general use, I thinkit's basically
a matter of personal preference.
In this case, it probably doesn't really matter: He's done 2>&1 on
the piped open, so there's no way to predict when the buffers will be
flushed or where stderr will be inserted into stdin. some of the
input is going to be munged either way.
Jay
.
- References:
- Re: REGEXP removing - il- - -b-f and - il- - - - f
- From: DBSMITH
- Re: REGEXP removing - il- - -b-f and - il- - - - f
- From: Jay Savage
- Re: REGEXP removing - il- - -b-f and - il- - - - f
- From: Ing. Branislav Gerzo
- Re: REGEXP removing - il- - -b-f and - il- - - - f
- Prev by Date: Re: REGEXP removing - il- - -b-f and - il- - - - f
- Next by Date: Re: Edit Windows PATH
- Previous by thread: Re: REGEXP removing - il- - -b-f and - il- - - - f
- Next by thread: Re: REGEXP removing - il- - -b-f and - il- - - - f
- Index(es):
Relevant Pages
|