Bill Ricker wrote:
The Andy and the ack project have built a better grep with perl.
http://perladvent.pm.org/2006/5/
search.cpan.org/~petdance/ack/ack
petdance.com/ack/
Thank you again for pointing this out! I use ack several times a week,
if not daily. It has saved me from having to
Thank you for all the great solutions!
Because of my extremely limited *nix knowledge, I'd use the approach of two
grep's in a pipeline, such as the one grep '^\*' yourFile | grep -v
'^\*INDICATOR' suggested by Michael, as it's simple to understand and easy
to memorize.
Thank you again.
Zhao
On 9/6/07, Kent Johnson [EMAIL PROTECTED] wrote:
Tom Buskey wrote:
On 9/6/07, *G.O.* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
wrote:
egrep ^\*[^INDICATOR] filename.txt
That excludes lines beginning with * and any of the characters INDCATOR,
i.e. *N, *D, etc will all be
Bill Ricker wrote:
Or, if you only have an old grep, but do have Perl, the following should
work:
The Andy and the ack project have built a better grep with perl.
Cool. By default ack ignores plain text files, so you have to tell it to
include them even when explicitly specifying the
On 9/7/07, Tom Buskey [EMAIL PROTECTED] wrote:
egrep -P ^\*(?!INDICATOR) filename.txt
GNU egrep 2.5.1 doesn't work:
$ egrep '^\*(?!INDICATOR)' z
$
You need to specify -P (or --perl) to turn on support for Perl
regular expression extensions.Otherwise it will interpret the (?
as...
Will if you're going to go into 3-letter tools that start with 'a'
that can do the requested task, then I'm just going to have to tell
everyone how to do it with awk
awk '/^\*/ !/^\*INDICATOR/ { print $0 }' file
awk takes a pattern and then a set of things to do with lines that
match that
Hi,
I have a text file whose content looks like below:
*INDICATOR name1 zip1
geoid gender location
*INDICATOR name2 zip2
*geoid gender location
INDICATOR name3 zip3
*district court
I want to pick up all lines starting with * but no INDICATOR
followed.
So for the example above, I want to pick
grep '^\*' yourFile | grep -v '^\*INDICATOR'
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
egrep '^\*' FILE | egrep -v '^\*INDICATOR'
I'm not sure how you'd combine them into one REGXP.
I'm sure there's a better way in perl (GNU egrep will do perl with -P)
On 9/6/07, Jerry [EMAIL PROTECTED] wrote:
Hi,
I have a text file whose content looks like below:
*INDICATOR name1 zip1
I want to pick up all lines starting with * but no INDICATOR
followed.
I'd double-grep it, but i'm not infront of a *nix box to check
grep -i * | grep -v *INDICATOR filename
or something to that effect.
--
~ *
___
gnhlug-discuss mailing list
egrep ^\*[^INDICATOR] filename.txt
gurhan
On 9/6/07, Jerry [EMAIL PROTECTED] wrote:
Hi,
I have a text file whose content looks like below:
*INDICATOR name1 zip1
geoid gender location
*INDICATOR name2 zip2
*geoid gender location
INDICATOR name3 zip3
*district court
I want to
On 9/6/07, G.O. [EMAIL PROTECTED] wrote:
egrep ^\*[^INDICATOR] filename.txt
gurhan
That didn't work for me, but this did:
egrep '^\*[^I][^N][^I][^D][^I][^C][^A][^T][^O][^R]' filename.txt
On 9/6/07, Jerry [EMAIL PROTECTED] wrote:
Hi,
I have a text file whose content looks like
Tom Buskey wrote:
On 9/6/07, *G.O.* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
wrote:
egrep ^\*[^INDICATOR] filename.txt
That excludes lines beginning with * and any of the characters INDCATOR,
i.e. *N, *D, etc will all be excluded.
That didn't work for me, but this did:
On 9/6/07, Kent Johnson [EMAIL PROTECTED] wrote:
perhaps this:
egrep -P ^\*(?!INDICATOR) filename.txt
Assuming your grep supports the Perl regular expression extensions
(a useful thing to have), that should work.
Or, if you only have an old grep, but do have Perl, the following should
Or, if you only have an old grep, but do have Perl, the following should
work:
The Andy and the ack project have built a better grep with perl.
http://perladvent.pm.org/2006/5/
search.cpan.org/~petdance/ack/ack
petdance.com/ack/
ack is pure Perl, so consistent across all platforms. Command
15 matches
Mail list logo