I have the below input (thousanda thousand lines). I want a sed command to merge duplicated lines with the same fistfirst three filed but addsfields which adds only different fields and delete Nor deletes "N/AA":
D04005;4;279;0;0;SSM-4-1 D04005;5;40;0;0;SSM-5-1 LE040A;1;363;(26.3);N/A;SM-1-1 LE040A;1;363;(27.4);N/A;SM-1-2 Expected output:
D04005;4;279;0;0;SSM-4-1 D04005;5;40;0;0;SSM-5-1 LE040A;1;363;(26.3);(27.4);SM-1-1/SM-1-2