grep and sed to find a pattern and add newline

Hello All,
I have log file the result from a multithreaded process. So when a process finishes it will write to this log file as 123 rows merged.
The issue is sometimes the processess finish at the same time or write to the file at the same time as
123 rows merged.145 rows merged.
At the end of the script we do a source count from table and target count from log file. As you can see the above line will fail grep as grep will identify the line and move on while awk will take the first parameter as 123 only.
I have used the following command to correct this

grep -i "^[0-9].* rows merged" ttt | sed 's/merged\./merged\
/g' | grep -i "^[0-9].* rows merged" | sed '/^$/'d | awk '{print $1}' | while read X
do
echo $X
Y=`expr $Y + $X`
done
echo $Y
TCOUNT=${Y}
but there was another instance when this script failed because the log file has something like
Commit complete.150 rows merged.Commit complete.
The above 150 rows that were merged didn't get counted. I would like to find [0-9].* rows merged anywhere on any line and separate this pattern into a new line
EG: the above Commit complete.150 rows merged.Commit complete.
should become
Commit complete.
150 rows merged.
Commit complete.
Any help will be greatly appreciated.
Thanks

Ok. Quit posting the same question twice. If people want to/are able to answer your question then they will. Be patient.

Sorry didn't realize it was posted twice. I apologize. I already found a solution.
Thanks
Suresh

awk '
  BEGIN{FS="."}
  {
    t=$0
    for(i=1 ; i <= NF; i++)
    {
        if ( match($i,"[0-9].* rows merged")> 0)
        {
            print $i
        }
    }
  } ' logfile


Try that as a start.

Duplicate threads/posts merged.

The awk script worked very fine. The other fix I had using grep and sed to filter what I need doesn't work very well. It atleast has a tendency to fail. But the awk works just fine.
Thanks
Suresh