02-11-2011 07:40 AM
Hello All,
I have a array as shown below Array one and have to arrage as shown below array 2
Array one Array Two
N1-Network-01 N1-Network-01
N1-Network-01 N1-Network-02
N1-Network-01 N1-Network-03
N1-Network-01 N2-Network-01
N1-Network-02 N2-Network-02
N1-Network-02
N1-Network-03
N2-Network-01
N2-Network-01
N2-Network-02
Data in array one will keep on changing it wont be fixed... Sometimes N1-network-01 once will come sometimes 10 times. But in second it should come just for one. I have done bit coding which i am attaching you.
Thanks so much..
Solved! Go to Solution.
02-11-2011 08:09 AM
02-11-2011 08:14 AM
02-11-2011 08:20 AM
Try this. There are probably more efficient ways but I will leave that exercise for you.
02-11-2011 09:02 AM
Thanks all...
I was doing just opposite of what u all told so was not getting it... Thanks so much...
02-11-2011 09:58 AM - edited 02-11-2011 09:58 AM
I'd like to point out that the proposed solution wont work for all cases. Add another N1-Network-01 to the end of the array. The current solution won't add it. If you will always have the N1's grouped together (such as you sort the array first) then it won't be a problem. But if you aren't sorting the array you will run into an issue.
See the output difference in the attached snippet

02-11-2011 10:02 AM
Hi Imstuck,
Yes u r right i have already used this type of sorting and then only i get all N1's then N2's etc and that array only i have posted. Thanks so much so
much for prompt posts... Thanks
02-11-2011 10:03 AM
Good deal, I had assumed as much. Just wanted to make sure so you didn't have any outlying points.
02-11-2011 10:11 AM
Hi,
Thanks so much for the concern....