extraction of data from a text file which follows certain pattern

hi everybody,

i have a file, in it I need to extract some data that follows a particular pattern..

For example: my file contains like

         now running Speak225
  
         sep 22 mon 16:34:05 2008

         \--------------------------------
        \-------------------------------- 

        now running BBp499
  
         sep 22 mon 16:36:15 2008
         \------------------------------
         \----------------------------

I need to get the names which follows "now running" and times in the precceding lines...

 for that i need to get the line numbers and extract the required information..
 Can anyone please help me.. That pattern exists so many times in the file and i need to get for all the times it happens using shell scripting .thank you
cat File.txt
now running Speak225
sep 22 mon 16:34:05 2008
sep 22 mon 16:34:05 2008
sep 22 mon 16:34:05 2008
now running BBp499
sep 22 mon 16:36:15 2008
sep 22 mon 16:34:05 2008
sep 22 mon 16:36:15 2008
 
grep 'now running' File.txt | awk '{print $3; cnt++;} END {print "No occurance is " cnt;}'
> cat file2
now running Speak225
sep 22 mon 16:34:05 2008
sep 22 mon 16:34:05 2008
sep 22 mon 16:34:05 2008
now running BBp499
sep 22 mon 16:36:15 2008
sep 22 mon 16:34:05 2008
sep 22 mon 16:36:15 2008

> cat file2 | sed "s/now running/~$2/g" | tr "\n" " " | tr "~" "\n" | cut -d" " -f2,6

Speak225 16:34:05
BBp499 16:36:15

cat file2 | sed "s/now running/~$2/g" | tr "\n" " " | tr "~" "\n" | cut -d" " -f2,6

Thank you so much for your response and the solution..

It worked fine..

But i forgot to specify in my question that the names may contain two or three words separated by spaces between them..

Like

   now running Speak225 freemin 

    sep 22 mon 16:34:05 2008

--------------------------------
--------------------------------

 now running BBp499 freesms local

 sep 22 mon 16:36:15 2008
\------------------------------
\----------------------------

If you dont mind, Please help me in getting those names i.e "Speak225 freemin" , "BBp499 freesms local" and their respective timings...

That means i need to get all the words in the line after "now running" till the end of that line and the timings from the next line

please...

thank you once again for your response..

If possible please tell me what is "-f2"..

You can also do what you want to do entirely within sed using back references ....

$ sed 's/now running \(.*\)/\1/;N; s/\n/ /; s/\(^.* \)\(... .. ... \)\(..:..:..\).*/\1\3/' file
Speak225 freemin 16:34:05
BBp499 freesms local 16:36:15
$