Computing.Net > Forums > Unix > plz help me, stuck on grep prob

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

plz help me, stuck on grep prob

Reply to Message Icon

Name: aram
Date: April 18, 2003 at 03:20:28 Pacific
OS: unix
CPU/Ram: 256
Comment:

hello everybody i need some help on grep.
lets say i have a file named "results" and this contains following

00001111000011110000
01010101111010111111
00000011111110000011
00010101000111000000
01010101011111110101
11110000000000111000

etc etc....(up to about 20 lines)

i want exclude all binary string that includes repetition of exactly four 1's
more then four or less then four is O.K
so for example 1011010111100 will be excluded but 11100011100011111 will be fine

can anyone help???
what do i have to type in ??




Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: April 21, 2003 at 12:19:48 Pacific
Reply:

I created a file "binary.txt" with the contents matching your example. I believe this answers your question.

grep -v '^11110' binary.txt | \
grep -v '01111$' | \
grep -v '011110'


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: plz help me, stuck on grep prob

How to....Plz Help! www.computing.net/answers/unix/how-toplz-help/4860.html

plz help me www.computing.net/answers/unix/plz-help-me/4948.html

Please help me install voodoo2 www.computing.net/answers/unix/please-help-me-install-voodoo2/424.html