duplicating a line

I have a text file which is the results of running a tests hundreds of times. For simplicity let's say that each test consists of 5 lines of text numbered 1-5 e.g.

 1 aaa aaa aaa

 2 bbb bbb bbb

 3 ccc ccc ccc

 4 ddd ddd ddd

 5 eee eee eee

 1 aaa aaa aaa

 2 bbb bbb bbb

 3 ccc ccc ccc

 4 ddd ddd ddd

 5 eee eee eee
etc.

What I need to do is to insert an additional line of text into each test. So now the text file above would read:

 1 aaa aaa aaa

 2 bbb bbb bbb

 3 ccc ccc ccc

 3b ccc ccc ccc

 4 ddd ddd ddd

 5 eee eee eee

 1 aaa aaa aaa

  2 bbb bbb bbb

  3 ccc ccc ccc

 3b ccc ccc ccc

  4 ddd ddd ddd

  5 eee eee eee
etc.

I tried to do the find and replace with the text editor I'm using but it only replaces a single line. You can't replace a line with itself followed by a blank line followed by the new line. I was hoping it this could done using a script

Hi, try:

awk '1; $1==3{print RS s}' s=" 3b ccc ccc ccc" infile

Thanks Scrutinizer, that worked perfectly. Do you mind explaining how it works please.

Sure:

awk '
 1                            # Perform the default action: {print $0} (print the line)
 $1==3{                       # if the first field equals 3
   print RS s                 # then print a newline and print string "s"
  }
' s=" 3b ccc ccc ccc" infile  # set string "s" to the desired value

Thanks again