Format Ouput

I have this input file

 
Switch 0; Sun Sep 11 12:40:53 2011 EDT (GMT+4:00)
12:40:53.159984 SCN Port Offline;g=0x1e4b6                  A2,P0  A2,P0  379   NA    
12:40:53.159991 *Removing all nodes from port               A2,P0  A2,P0  379   NA    
18:45:31.326604 Port Elp engaged                            A2,P1  A2,P0  4     NA    
18:45:31.326609 SCN Port F_PORT                             A2,P1  A2,P0  4     NA    
18:45:31.326616 *Removing all nodes from port               A2,P0  A2,P0  4     NA    
Switch 0; Mon Sep 12 04:12:22 2011 EDT (GMT+4:00)
04:12:22.729711 SCN Port Offline;g=0x1e4ce                  A2,P0  A2,P0  302   NA    
04:12:22.729719 *Removing all nodes from port               A2,P0  A2,P0  302   NA    
04:14:12.719175 SCN LR_PORT (0);g=0x1e4ce                   A2,P0  A2,P0  302   NA    
04:14:12.720048 SCN Port Online;g=0x1e4ce                   A2,P0  A2,P1  302   NA    
 

Basically i want the date before each line like this

 
Switch 0; Sun Sep 11 12:40:53 2011 EDT (GMT+4:00)
Sun_Sept11_2011-12:40:53.159984 SCN Port Offline;g=0x1e4b6                  A2,P0  A2,P0  379   NA    
Sun_Sept11_2011-12:40:53.159991 *Removing all nodes from port               A2,P0  A2,P0  379   NA    
Sun_Sept11_2011-18:45:31.326604 Port Elp engaged                            A2,P1  A2,P0  4     NA    
Sun_Sept11_2011-18:45:31.326609 SCN Port F_PORT                             A2,P1  A2,P0  4     NA    
Sun_Sept11_2011-18:45:31.326616 *Removing all nodes from port               A2,P0  A2,P0  4     NA    
Switch 0; Mon Sep 12 04:12:22 2011 EDT (GMT+4:00)
Mon_Sep12_2011-04:12:22.729711 SCN Port Offline;g=0x1e4ce                  A2,P0  A2,P0  302   NA    
Mon_Sep12_2011-04:12:22.729719 *Removing all nodes from port               A2,P0  A2,P0  302   NA    
Mon_Sep12_2011-04:14:12.719175 SCN LR_PORT (0);g=0x1e4ce                   A2,P0  A2,P0  302   NA    
Mon_Sep12_2011-04:14:12.720048 SCN Port Online;g=0x1e4ce                   A2,P0  A2,P1  302   NA    

Thanks

awk '/^Switch/{s1=$3;s2=$4;s3=$5;s4=$7}!/^Switch/{$0=s1"_"s2""s3"_"s4"-"$0}1' input
1 Like