Hi all,
I have a requirement to covert multiple lines in a comma delimited file to a single line through shell scripting. We should compare the data in the first column in each line. If it is same, then the other data should be put in the same line.Below is the sample input and expected output:
Input:
ABC,AD,AS,ER
ABC,YT,YU,ER
ABC,GT
BVT,SD,WER,YUI,GHY,TRE
BVT,G,DRT,FE,GHW
MN,FR,ER,YU,WS,FH,YU,IO,DER
ABC,SE
Output:
ABC,AD,AS,ER,YT,YU,ER,GT
BVT,SD,WER,YUI,GHY,TRE,G,DRT,FE,GHW
MN,FR,ER,YU,WS,FH,YU,IO,DER
ABC,SE
I tried this using awk but was successful to convert a single line to multiple line and not visa versa.
Please help.