Re: REGEXP removing - il- - -b-f and - il- - - - f
- From: daggerquill@xxxxxxxxx (Jay Savage)
- Date: Wed, 27 Apr 2005 11:40:26 -0400
On 4/27/05, JupiterHost.Net <mlists@xxxxxxxxxxxxxxx> wrote:
>
> > If all you want is the last column, this is a really long way to go about it.
> >
> > while (<V4>) {
> > print (split)[7];
> > print "\n";
> > }
>
> I think that won't work due to some rows formatted like so:
>
> 2005/01/20 15:39 17 2% -il-o-b- - - - - sg F01000
>
> unless that was typo?
>
> In that case "7" isn't always the index of the last item in the list
> from split.
>
> while (<V4>) {
> my @tmp = split;
> print "$tmp[ $#tmp ]\n";
> }
>
I was assuming it was a typo/email munge, and that the command he
pipes actually produces consistent output. That may be a faulty
assumption on my part. YOu know what they say about assumptions In
general, though, when parsing log files (which seems to be waht's
going on here) if you're assured reasonably consisten data, it's
better IMNSHO to look for a particular index, because loggers are more
likely to add occasional extranious info or comments at the end of the
line than in the middle.
YMMV,
Jay
.
- Follow-Ups:
- Re: REGEXP removing - il- - -b-f and - il- - - - f
- From: JupiterHost.Net
- Re: REGEXP removing - il- - -b-f and - il- - - - f
- 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: JupiterHost.Net
- Re: REGEXP removing - il- - -b-f and - il- - - - f
- Prev by Date: Re: Edit Windows PATH
- Next by Date: Re: Spread***::ParseExcel - Out of memory error
- 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):