Skip to main content
2 of 4
edited tags
Tony
  • 91
  • 6

Merge duplicated lines which have the same fist three filed

I have the below input (thousand lines). I want a SED command to merge duplicated lines with the same fist three filed but adds only different fields and delete N/A

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 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 
Tony
  • 91
  • 6