Limiting the consecutive occurrence
#91
(06-01-2012, 01:55 AM)M@LIK Wrote:
Pixel Wrote: OK I'll explain more, what I meant was two repeat instances total any where in the whole line, so in QVHHRIRA, the two Hs is one instance and the two Rs would be the second instance.

Oh I get you, that wasn't very easy to do.
No more than 2 instances of a duplicate character:
Code:
/\(.\).*\1.*\(.\).*\2.*\(.\).*\3/d
/\(.\).*\1.*\(.\).*\(.\).*\2.*\3/d
/\(.\).*\1.*\(.\).*\(.\).*\3.*\2/d
/\(.\).*\(.\).*\1.*\2.*\(.\).*\3/d
/\(.\).*\(.\).*\1.*\(.\).*\2.*\3/d
/\(.\).*\(.\).*\1.*\(.\).*\3.*\2/d
/\(.\).*\(.\).*\2.*\1.*\(.\).*\3/d
/\(.\).*\(.\).*\2.*\(.\).*\1.*\3/d
/\(.\).*\(.\).*\2.*\(.\).*\3.*\1/d
/\(.\).*\(.\).*\(.\).*\1.*\2.*\3/d
/\(.\).*\(.\).*\(.\).*\1.*\3.*\2/d
/\(.\).*\(.\).*\(.\).*\2.*\1.*\3/d
/\(.\).*\(.\).*\(.\).*\2.*\3.*\1/d
/\(.\).*\(.\).*\(.\).*\3.*\1.*\2/d
/\(.\).*\(.\).*\(.\).*\3.*\2.*\1/d

Yup all these, don't forget to remove the previous rule:
Code:
/\(.\).*\(.\).*\1.*\2/d
/\(.\).*\(.\).*\2.*\1/d

Thanks M@LIK your the best. Oh WOW, lot of commands for this one. Do you know and good sed tutorials that are good? I have had a look but, just wanted to see if you had any that you would recommend having a you at?


M@LIK I think I found a bug:


QVHHABFY
QVHHABFZ
QVHHABGA
QVHHABGB
QVHHABGC
QVHHABGD
...

QVHHBJDA
QVHHBJDB
QVHHBJDC
QVHHBJDD
QVHHBJDE
QVHHBJDF

The red ones are missing .

Code:
mp64.exe QVHH?u?u?u?u --stop-at QVHHRIZZ|sed -f  awesome_script.txt>Q.txt

In the text file EDIT BELOW
Code:
/\(.\)\1\1/d
/\(.\).*\1.*\1/d
/\(.\).*\1.*\(.\).*\2/d
/\(.\).*\1.*\(.\).*\2.*\(.\).*\3/d
/\(.\).*\1.*\(.\).*\(.\).*\2.*\3/d
/\(.\).*\1.*\(.\).*\(.\).*\3.*\2/d
/\(.\).*\(.\).*\1.*\2.*\(.\).*\3/d
/\(.\).*\(.\).*\1.*\(.\).*\2.*\3/d
/\(.\).*\(.\).*\1.*\(.\).*\3.*\2/d
/\(.\).*\(.\).*\2.*\1.*\(.\).*\3/d
/\(.\).*\(.\).*\2.*\(.\).*\1.*\3/d
/\(.\).*\(.\).*\2.*\(.\).*\3.*\1/d
/\(.\).*\(.\).*\(.\).*\1.*\2.*\3/d
/\(.\).*\(.\).*\(.\).*\1.*\3.*\2/d
/\(.\).*\(.\).*\(.\).*\2.*\1.*\3/d
/\(.\).*\(.\).*\(.\).*\2.*\3.*\1/d
/\(.\).*\(.\).*\(.\).*\3.*\1.*\2/d
/\(.\).*\(.\).*\(.\).*\3.*\2.*\1/d


EDIT:

It looks like its this line
Code:
/\(.\).*\1.*\(.\).*\2/d
it seems to work without this line. what did this line do?


Messages In This Thread
Limiting the consecutive occurrence - by Hash-IT - 05-23-2012, 12:38 AM
RE: Limiting the consecutive occurrence - by ntk - 05-27-2012, 01:28 PM
RE: Limiting the consecutive occurrence - by TAPE - 05-27-2012, 11:36 PM
RE: Limiting the consecutive occurrence - by ntk - 05-28-2012, 09:57 AM
RE: Limiting the consecutive occurrence - by ntk - 05-29-2012, 12:12 AM
RE: Limiting the consecutive occurrence - by ntk - 05-29-2012, 02:19 AM
RE: Limiting the consecutive occurrence - by ntk - 05-29-2012, 04:02 AM
RE: Limiting the consecutive occurrence - by ntk - 05-30-2012, 10:11 AM
RE: Limiting the consecutive occurrence - by Pixel - 06-01-2012, 05:42 AM
RE: Limiting the consecutive occurrence - by ntk - 06-01-2012, 11:30 PM
RE: Limiting the consecutive occurrence - by ntk - 06-02-2012, 10:48 AM
RE: Limiting the consecutive occurrence - by ntk - 06-03-2012, 12:56 AM
RE: Limiting the consecutive occurrence - by ntk - 06-03-2012, 01:07 PM
RE: Limiting the consecutive occurrence - by ntk - 06-03-2012, 02:14 PM
RE: Limiting the consecutive occurrence - by ntk - 06-05-2012, 02:08 AM
RE: Limiting the consecutive occurrence - by ntk - 06-05-2012, 02:48 AM
RE: Limiting the consecutive occurrence - by aGia - 06-07-2012, 11:26 PM
RE: Limiting the consecutive occurrence - by ntk - 06-08-2012, 12:13 AM
RE: Limiting the consecutive occurrence - by aGia - 06-08-2012, 12:24 AM
RE: Limiting the consecutive occurrence - by ntk - 06-08-2012, 12:29 AM
RE: Limiting the consecutive occurrence - by ntk - 06-08-2012, 01:52 AM
RE: Limiting the consecutive occurrence - by d333 - 09-04-2012, 01:56 PM
RE: Limiting the consecutive occurrence - by atom - 09-04-2012, 02:04 PM