Philippe Glaziou <[EMAIL PROTECTED]> wrote: > I see and here is my (corrected) sed solution: > > cunegonde:~/tmp> cat test > 2.22 3.45 > 1.56 2.31 > pattern 1 > 4.67 7.91 > 3.34 2.15 > 5.32 3.88 > pattern 2 > > cunegonde:~/tmp> sed -e '/pattern 1\|pattern 2/D' <test > 2.22 3.45 > 1.56 2.31 > 4.67 7.91 > 3.34 2.15 > 5.32 3.88
Ray Brownrigg rightly pointed out my mistake: we want the lines between the patterns not just to remove the patterns. I pulled the trigger too fast. cunegonde:~/tmp> sed -e '/pattern 1/,/pattern 2/!D;/pattern 1\|pattern 2/D' <test 4.67 7.91 3.34 2.15 5.32 3.88 I feel embarrassed now. -- Philippe ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help