I have this input but it might be different (have more similar entries) 

```
Total Devices : 2

DEV#:   0  DEVICE NAME: Disk1 Part0  TYPE: 2145       POLICY: OPTIMIZED
SERIAL: 60050768018E033EC0000000000011A8
============================================================================
Path#            Adapter/Hard Disk        State  Mode       Select     Errors
    0     Scsi Port0 Bus0/Disk1 Part0     OPEN   NORMAL          0          0
    1     Scsi Port0 Bus0/Disk1 Part0     OPEN   NORMAL   17288503          0
    2     Scsi Port2 Bus0/Disk1 Part0     OPEN   NORMAL          0          0
    3     Scsi Port2 Bus0/Disk1 Part0     OPEN   NORMAL   17312166          0

DEV#:   1  DEVICE NAME: Disk2 Part0  TYPE: 2145       POLICY: OPTIMIZED
SERIAL: 60050768018E033EC0000000000011A9
============================================================================
Path#            Adapter/Hard Disk        State  Mode       Select     Errors
    0     Scsi Port0 Bus0/Disk2 Part0     OPEN   NORMAL   10322705          0
    1     Scsi Port0 Bus0/Disk2 Part0     OPEN   NORMAL          0          0
    2     Scsi Port2 Bus0/Disk2 Part0     OPEN   NORMAL   10321466          0
    3     Scsi Port2 Bus0/Disk2 Part0     CLOSE  DEAD            0          0

```

I would like to have an output like this: 

```
DEV#:   0  DEVICE NAME: Disk1 Part0  TYPE: 2145       POLICY: OPTIMIZED;SERIAL: 60050768018E033EC0000000000011A8;0;Scsi Port0 Bus0/Disk1 Part0;OPEN;NORMAL;0;0
DEV#:   0  DEVICE NAME: Disk1 Part0  TYPE: 2145       POLICY: OPTIMIZED;SERIAL: 60050768018E033EC0000000000011A8;1;Scsi Port0 Bus0/Disk1 Part0;OPEN;NORMAL;17288503;0
DEV#:   0  DEVICE NAME: Disk1 Part0  TYPE: 2145       POLICY: OPTIMIZED;SERIAL: 60050768018E033EC0000000000011A8;2;Scsi Port2 Bus0/Disk1 Part0;OPEN;NORMAL;0;0
DEV#:   0  DEVICE NAME: Disk1 Part0  TYPE: 2145       POLICY: OPTIMIZED;SERIAL: 60050768018E033EC0000000000011A8;3;Scsi Port2 Bus0/Disk1 Part0;OPEN;NORMAL;17312166;0
DEV#:   1  DEVICE NAME: Disk2 Part0  TYPE: 2145       POLICY: OPTIMIZED;SERIAL: 60050768018E033EC0000000000011A9;0;Scsi Port0 Bus0/Disk2 Part0;OPEN;NORMAL;10322705;0
DEV#:   1  DEVICE NAME: Disk2 Part0  TYPE: 2145       POLICY: OPTIMIZED;SERIAL: 60050768018E033EC0000000000011A9;1;Scsi Port0 Bus0/Disk2 Part0;OPEN;NORMAL;0;0
DEV#:   1  DEVICE NAME: Disk2 Part0  TYPE: 2145       POLICY: OPTIMIZED;SERIAL: 60050768018E033EC0000000000011A9;2;Scsi Port2 Bus0/Disk2 Part0;OPEN;NORMAL;10321466;0
DEV#:   1  DEVICE NAME: Disk2 Part0  TYPE: 2145       POLICY: OPTIMIZED;SERIAL: 60050768018E033EC0000000000011A9;3;Scsi Port2 Bus0/Disk2 Part0;CLOSE;DEAD;0;0

```

I tried this:

```
sed "/=/d;{:q;N;s/\n/;/g;t q};s/;;/;/g" input.txt

```

What is wrong?