Help in replacing two blank lines with two lines of diff data

Hi.. I'm facing a trouble in replacing two blank lines in a file using shell script...
I used sed to search a line and insert two blank lines after the searchd line using the following sed command.
sed "/data/{G;G;}/" filename . In the file, after data tag, two lines got inserted blank lines.. Now i'm trying to insert 2 different data into the same blank lines.. But cudn't get the command for that... Any help wud b appreciated...

Thanks in advance..

I think this is the continuation of the below question. Can I know y u created new thread and what u did to insert new lines??

http://www.unix.com/shell-programming-scripting/172343-needed-help-inserting-new-line.html

I used :

sed  "/<data>/{G;G;}/" fileName>tempFile 
 

to create two blank lines after searching for the tag <data>.... After creating blank lines I tried to replace them with two different data, but couldn't get the result.... sed could be used to make a single change to many lines only..

Where are these two lines of "data" coming from?

(siva shankar, as the question is the opposite of what was asked before, it can't be a continuation of the mentioned thread, IMO)

Its coming from a flat file and it will be choosed depending upon the value of <data> in the sed command.
after inserting the statements, the results would be like:

<modulename>$data1</modulename>
<submodulename>$data2</submodulename>

where $data1 and $data2 will be taken dynamically from another flat file using a loop.
These are two lines of data which i need to add...

---------- Post updated at 04:02 PM ---------- Previous update was at 03:41 PM ----------

I tried to use s/text1/text2/g... but here the blank lines are getting replaced by the same piece of line... :frowning:

---------- Post updated 12-03-11 at 09:48 AM ---------- Previous update was 12-02-11 at 04:02 PM ----------

Can we use two different sed to replace the first occurrence of blank statements with data?
I tried using sed -e 's/^$/mydata/' filename... but this command replaced both the blank statements with my data... is there any other option to replace the first occurrence of blank statement with my data?