in reply to Re^2: Selecting the difference between two strings
in thread Selecting the difference between two strings
If all of the information is of the format that you show in your original post, you could pretty easily form an indented list showing the branches.
For simplicity, let's call the text between slashes units. Now, sort the list ASCIbetically, and do a very simple loop that preserves the entry above. By comparing the current entry to the above entry, you could determine the number of tabs to print before the current entry. I.E if they have no units in common, we would print no spaces. If they have three units in common, but are both longer than three units, then we insert three tabs. If they have three units in common, but the above entry is only three units long, then we need four tabs.
Anyway, you can fit the particulars to what you want. To me, a Perl solution is one that's elegant in Perl, and not one that takes advantage of Perl's string abilities.
Hays
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Selecting the difference between two strings
by qazwart (Scribe) on Sep 27, 2006 at 03:42 UTC |