Merge multi-lines into one single line

Hi,

Can anyone help me for merge the following multi-line log which beginning with a number and time: into one line. For each line need to delete the return and add a space. Please see the red color line.

*****Original Log*****
087;2008-12-06;084403;mc;;SYHLR6AP1D\LNZW;AD-703;1;12475;SYHLR6AP1B;1.1.1.1;0000000062;HGPDI:MSISDN=12345678,APNID=1,EQOSID=365;

EXECUTED

;
187;2008-12-06;084403;mc;;SYHLR6AP1D\LNZW;AD-701;1;12473;SYHLR6AP1B;1.1.1.1;0000000129;HGSNC:MSISDN=12345678,NAM=0,KEEP;

NOT ACCEPTED
FAULT CODE 220
SUBSCRIBER NETWORK ACCESS MODE HAS ALREADY THAT VALUE

;

*****Log line merged*****
087;2008-12-06;084403;mc;;SYHLR6AP1D\LNZW;AD-703;1;12475;SYHLR6AP1B;1.1.1.1;0000000062;HGPDI:MSISDN=12345678,APNID=1,EQOSID=365; EXECUTED ;
187;2008-12-06;084403;mc;;SYHLR6AP1D\LNZW;AD-701;1;12473;SYHLR6AP1B;1.1.1.1;0000000129;HGSNC:MSISDN=12345678,NAM=0,KEEP; NOT ACCEPTED FAULT CODE 220 SUBSCRIBER NETWORK ACCESS MODE HAS ALREADY THAT VALUE ;

Thank You

HappyDay

Try this:

sed -e '/^$/d' file| tr '\n' ' '

or

awk '{printf("%s",$0)}'

cheers,
Devaraj Takhellambam

devtakh,
Thanks

Can it be done by perl?

Of course it can be done by perl.

$
$ cat -n input.txt
     1  087;2008-12-06;084403;mc;;SYHLR6AP1D\LNZW;AD-703;1;
     2
     3  EXECUTED
     4
     5  ;
     6  187;2008-12-06;084403;mc;;SYHLR6AP1D\LNZW;AD-701;1;
     7
     8  NOT ACCEPTED
     9  FAULT CODE 220
    10  SUBSCRIBER NETWORK ACCESS MODE
    11
    12  ;
$
$
$ perl -ne '{ chomp;
  if (!/^$/) {
    if ($buf eq "") {$buf = $_}
    elsif (/^[^;]/) {$buf = $buf." ".$_}
    else {$buf = $buf." ".$_; print "$buf\n"; $buf=""}
  }
}' input.txt
087;2008-12-06;084403;mc;;SYHLR6AP1D\LNZW;AD-703;1; EXECUTED ;
187;2008-12-06;084403;mc;;SYHLR6AP1D\LNZW;AD-701;1; NOT ACCEPTED FAULT CODE 220 SUBSCRIBER NETWORK ACCESS MODE ;
$
$

tyler_durden

This should work for you.

awk '/^;$/{f=0;print};f||/^[0-9]/{f=1;printf}' file