Align data of the paragraph

Hi,

I need your help to align data from paragraph.
It's to :

  • delete the lign contain NDS
  • align data between paragraph start to "ND=" from second "ND="

example of file:

@
ABOIL;

@
CEN=1/15-05-23/09 H 06 MN 18/LISTAGE CARACTERISTIQUES D'ABONNES
TRAITEMENT TGLAIL ACC
ND=31630000 NE =001-19-111 TAX = 00077947
TY= KLA+ SR4
CAT= IAM+ FD3+ RVT+ SRC+ CAM2+ IAI
MAR=ATT
ND=36851217 NE =027-07-011 TAX = 00000000
TY= KLA+ SR1
CAT= FD3+ SRC+ DAD1+ CAC14+ ZTX14+ ZG14
NDS=31656756 ND=31653755 
NDS=31656757 ND=31653755 
TRAITEMENT TGLAIL EXC

result of the script:

31630000;001-19-111;;;00077947;KLA+SR4;IAM+FD3+RVT+SRC+CAM2+IAI;ATT
31633161;002-13-115;;;00006845;KLA+SR1;FD3+DF2+SRC+DAD1+RVFO+RFNR;ARFO+ARFN
31651448;001-12-117;;;00000000;KLA+SR1;FD3+SRC+DAD1+RVFO+RFNR;ARFO+ARFN
31630003;;;;;;DF3;
35905483;028-05-076;;;00000000;KLA+SR1;FD3+SRC+IAI+DAD1+DIPA;ATT

If you want help with this, you need to provide a much better description of your input and output file formats!

You said you want to delete lines containing NDS . You didn't say anything about deleting lines containing @ , TRAITEMENT , etc.

There is no description of why some spaces are to be removed, why some tag=data sets are joined on lines and some are on separate lines. Especially with the varied spacing around the equal signs, it isn't obvious whether or not something that looks like a tag in the middle of a line is a tag or is data for an earlier tag on the same line.

There is no description of what data should be directed to some of the output fields. (Some fields are always empty. Is this because the tags for the wanted data are not present in your sample, or because that field is always supposed to be empty?)

What shell and operating system are you using?