Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: REGEXP removing - il- - -b-f and - il- - - - f
On 4/27/05, Ing. Branislav Gerzo <konfera@2ge.us> wrote:
> Jay Savage [JS], on Wednesday, April 27, 2005 at 10:26 (-0400)
> thoughtfully wrote the following:
>=20
> JS> If all you want is the last column, this is a really long way to go a=
bout it.
> JS>     while (<V4> ) {
> JS>         print (split)[7];
> JS>         print "\n";
> JS> }
>=20
> (split)[-1] is better, not ?
>=20

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

Report this thread to moderator Post Follow-up to this message
Old Post
Jay Savage
04-27-05 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:35 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.