So I am pretty new to what I currently refer to as "advanced" RegEx, please pardon me, it's probably really easy for you guys but I need to be pointed in the right direction because right now I am struggling.
I have crawled the forums and websites, (including: http://www.grymoire.com/Unix/Sed.html) and I can't find what I am looking for or at least, the reverse so I then reverse that and get the stdout that I want.
The data (stdin) looks like this:
C:\Users\Maison\Documents\AutoCad_dir True False 0 1 User Group Everyone Full Access S-I-D C:\Users\Maison\Documents True False 0 1 User Group Everyone Full Access S-I-D
And what I want to do is using RegEx, remove every line with 4 directories or more and the proceeding 10 lines (including the CR \r).
So what remains will look something like this:
C:\Users\Maison\Documents True False 0 1 User Group Everyone Full Access S-I-D
NOTE: The volume label (C:) is not constant, no data I am working with is absolute.
Of course in the actual data I possess, there are a lot more lines similar to the one I am trying to erase.
The best I have so far is:
sed '/pattern/I,+11 d' infile
But I cannot come up with a logical pattern, every pattern I have come up with so far erases every line regardless of directory count.
I was reluctant to ask but this ultimately will allow me to understand RegEx & GNU sed better.