What do the ".." stand for ?
1 word ?
more ?
Please post a full representative sample, not just a "kind of" sample.
The more precise a question is, the more precise the answer can be
---------- Post updated at 01:59 PM ---------- Previous update was at 01:33 PM ----------
sorry for giving half info so far
my sample data looks like this
21
### W dcf
### Wdcf HD
350
351
353
### abc Plus
36
### abc 2 WEST
### abc xyzZONE
### abc NEXT
### abc abcCASE WEST
### abc WEST
### abc WOMEN
### abcTIME
sed 's/\s*###\s*//;s/^\s*//' infile | awk '/^\s*$/{next}!/^[0-9][0-9]*/{B[x]=B[x]?B[x]","$0:$0}/^[0-9][0-9]*/{x=$1;A[$1]=$1" "}END{for(i in A)print A,(B)?"(":"",B,(B)?")":""}' OFS=''
# sed 's/\s*###\s*//;s/^\s*//;s/\s\s*/ /g' infile | awk '/^[0-9][0-9]*/{x=$1;A[$1]=$1" "}!/^[0-9][0-9]*/{B[x]=B[x]?B[x]","$0:$0}END{for(i in A)print A,(B)?"(":"",B,(B)?")":""}' OFS=''
36 (abc 2 WEST ,abc xyzZONE ,abc NEXT ,abc abcCASE WEST ,abc WEST ,abc WOMEN ,abcTIME)
350
351
353 (abc Plus )
21 (W dcf ,Wdcf HD )