So we are limiting it to this so far...
No more than 2 instance of upper alpha consecutively.
No more than 2 of any character within a single line
with this command
Which on letter "A" produces this
How would you limit the total amount of times a consecutive instance can happen to say one?
So in the line above "A" is the first character to appear twice, when the character "B" appear twice, the line would be deleted. Even if the line was
because "A" is still the first character to appear twice the line would still be deleted when the "B" appear twice as the second "A" came before the second "B"
Hope this make sense
Can this be done with sed?
No more than 2 instance of upper alpha consecutively.
No more than 2 of any character within a single line
with this command
Code:
sed "/\(.\)\1\1/d;/\(.\).*\1.*\1/d"
Which on letter "A" produces this
Code:
AABBCCDD
AABBCCDE
AABBCCDF
AABBCCDG
AABBCCDH
AABBCCDI
AABBCCDJ
AABBCCDK
How would you limit the total amount of times a consecutive instance can happen to say one?
Code:
AABBCCDD
So in the line above "A" is the first character to appear twice, when the character "B" appear twice, the line would be deleted. Even if the line was
Code:
ABCADEFB
because "A" is still the first character to appear twice the line would still be deleted when the "B" appear twice as the second "A" came before the second "B"
Hope this make sense
Can this be done with sed?