UNIX shell programming

Hi guys

i have two different line
input
M5.7&a : M5 minimum density is 20%, maximum density is 80%,
DENSITY PERM=M5.8&a(180) ......... 6 violations found.
M6.7&a : M6 minimum density is 20%, maximum density is 80%,
DENSITY A=M6.8&a(180) ......... 6 violations found.

need output like first word in first line and last 3 words in second line.like this i have more than 1500 lines

M5.7&a .........6 violations found.
M6.7&a......... 6 violations found.

can u please help me out and could u please expaline syntax also.

cheap and dirty:

#  awk '/^M/{t=$1;getline;t=t""$(NF-3)" "$(NF-2)" "$(NF-1)" "$NF;print t}' infile
M5.7&a......... 6 violations found.
M6.7&a......... 6 violations found.

(if you match a line beginning with M grab the first word on the line. read the next line and append the last 4 fields to the string then spit it out..)

awk '{printf (NR%2)?$1 FS:$(NF-2) FS $(NF-1) FS $NF RS}' infile