Change Log
2006.02.22 Add the second script.
2002.02.04 First version
Raw Input Desired Output
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 1
line 2
line 3
line 5
line 6
line 7
line 9
line 10
Script and Comments
Script1
[ 1] :loop
[ 2] /^\([^\n]*\n\)\{3\}/!{
[ 3] N
[ 4] b loop
[ 5] }
[ 6] s/\n[^\n]*$//
Comments
  1. Note:
    If you use sed other than GNU sed version 3.02.80, you have to do a little modification, please take a look at Important Notes.
  2. Line [1] thru [5] constitute a loop. This loop will repeat until the Pattern Space contains exactly 4 lines.
  3. Step [6] will remove the 4th line. After this step, sed will output all the lines of PS and start a new cycle.
Script2
[ 1] :loop
[ 2] N
[ 3] /\n[^\n]*\n/!b loop
[ 4] n
[ 5] d
Comments
  1. This script use a different approach from the last script:
    ActionSteps involved
    Get the first line, keep it in PS. 
    Join next line, repeat this until PS has 3 lines. Steps [1] thru [3] constitute such kind of loop.
    Now PS has 3 lines, print them and read next line. Step [4]
    Delete it, since it is the fourth line. Step [5]
  2. This script assumes that when the last line of a file is reached, command 'N' will print the contents of PS then terminate.