a simple question about grep
Tom Buskey
tom at buskey.name
Thu Sep 6 16:59:09 EDT 2007
On 9/6/07, G.O. <gurhan.ozen at gmail.com> 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 <greenmt at gmail.com> 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 pick up all lines starting with "*" but no "INDICATOR"
> > followed.
> >
> >
> > So for the example above, I want to pick up the following 2 lines:
> >
> >
> > (the 3rd line) *geoid gender location
> > (the last line) *district court
> >
> >
> > How to construct regular expression with grep as a one-line command to
> > achieve this goal? Or any other simple solutions?
> > Thank you!
> >
> > Zhao
> >
> > _______________________________________________
> > gnhlug-discuss mailing list
> > gnhlug-discuss at mail.gnhlug.org
> > http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
> >
> >
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20070906/9a092e24/attachment.html
More information about the gnhlug-discuss
mailing list