|
Hi,
I am trying to match the order of letters (separated by commas) in Column1
with Column2. The correct matches are the ones with only one letter in
Column1 (eg., "a" matched with "One", "b" with "Two", "c" with "Three" and
so on). When there are multiple letters (for eg., "a, c, e" as in ID 10),
the substrings in Column2 are not correctly matched. Please post any
suggestions on reordering the substrings in Column2 so as to match the
letter order in Column1.
Input:
======
ID Column1 Column2
1 a One
2 b Two
3 d Four
4 a, d Four, One
5 e Five
6 b, c, d Three, Four, Two
7 c Three
8 a, b, c, d One, Three, Four, Two
9 a One
10 a, c, e One, Five, Three
Required output:
================
ID Column1 Column2
1 a One
2 b Two
3 d Four
4 a, d One, Four
5 e Five
6 b, c, d Two, Three, Four
7 c Three
8 a, b, c, d One, Two, Three, Four
9 a One
10 a, c, e One, Three, Five
Thank you in advance.
Sid
|