[EMAIL PROTECTED] wrote: > Perlers > > I need to remove any line that begins with \d+ yet end with \s* > Here is the data > > _BEGIN_DATA_ > > 0 2005/09/23 17:25 221 100% -il-o-b---U- sf F02043 > 72 2005/10/07 17:12 524 100% -il-o-b---U- sf H02053 > 73 2005/10/10 13:23 288 100% -il-o-b---U- sf F02044 > 74 none 0 0% -il-o------- sf H02005 > 75 2005/10/14 15:26 234 100% -il-o-b---U- sf F02032 > 76 2005/10/19 20:12 256 100% -il-o-b---U- sf F02033 > 77 2005/10/25 11:46 273 100% -il-o-b---U- sf F02034 > 96 2005/12/30 18:18 379 100% -il-o-b---U- sf H02054 > 97 > 98 2006/01/09 23:15 220 100% -il-o-b---U- sf F02058 > 99 > 100 2006/01/16 10:14 215 100% -il-o-b---U- sf F02059 > 101 > 103 2006/01/28 02:27 156 100% -il-o-b---U- sf F02061 > 104 2006/01/28 03:45 248 100% -il-o-b---U- sf F02057 > 105 2006/01/29 21:53 260 100% -il-o-b---U- sf H02052 > 106 2006/02/03 13:26 201 100% -il-o-b---U- sf F02062 > 107 2006/02/09 14:50 194 100% -il-o-b---U- sf F02063 > 108 2006/02/17 09:48 171 100% -il-o-b---U- sf F02064 > 109 > 110 2006/02/18 00:26 273 100% -il-o-b---U- sf H02000 > 111 2006/02/20 06:15 204 100% -il-o-b---U- sf F02021 > > _END_DATA_ > > > Here is what I came up with and it works but any other ideas b/c I am > unsure for every line with "2006/01/16 10:14 215 100% -il-o-b---U- > sf F02059" > for example will have a length of 62 or more. > thank you! > > > > use strict; > use warnings; > > open (L999, "samcmd v4 999 |" ) or die "unable to open pipe... > Broken? $!"; for (;<L999>;) { > if ($lc > 7) { is the format for the end of line constant? That is annnnn like F020021, ete. Then could do 1) /\b[a-z]\d{5}$/i or 2) ! /^\s+\d+\s*$/ Either of the regex would replace the two ifs to be one.
Wags ;) > if (length $_ >= 62) { > print $_; > } > #y{-,%,[ilbodsgfER]}//d; > #$ns=substr($_,30); > #$fa[$O++] = $ns if (substr($ns, 1,3) == 100); > } > $lc++; > } > > > Derek B. Smith > OhioHealth IT > UNIX / TSM / EDM Teams ******************************************************* This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. ******************************************************* -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>