Source Data: /foo/bar/xzy /foo/bar/xzy/asdf /foo/bar/xasdf /bar/foo/asdf /bar/asdf/foo - Control string all positive in the beginning (must now the length of the lognest string) - Control string can only switch from 1 to 0 not from 0 to 1 Setp 0 - Initiliaze Control String Control: 11111111111111111 Step 1 - compare line 1 and 1+1 Line 1: /foo/bar/xzy Line 2: /foo/bar/xzy/asdf Control: 11111111111100000 Step 2 - compare line 2 and 2+1 Line 2: /foo/bar/xzy/asdf Line 3: /foo/bar/xasdf Control: 11111111110000000 Setp 3 Line 3: /foo/bar/xasdf Line 4: /bar/foo/asdf Control: 10001000100000000 Step4 Line 4: /bar/foo/asdf Line 5: /bar/asdf/foo Control: 10000000000000000 Step5: Count how many 1 are in the control string, beginning from left, breaking at first 0 Step6: remove that many characters from the beginning of each source string.