in reply to String parsing

You could try splitting on '_' and creating hashes of hashes of hashes of ...

Why does VLAN_General get its own bucket. It seems as if it should go with the bucket right above it.

Replies are listed 'Best First'.
Re^2: String parsing
by Anonymous Monk on Mar 25, 2010 at 19:10 UTC
    ya unfortunately the order above is completely random...but I think your idea of multiple hashes might do the trick. I'll give it a try.

    Thanks!

      Hashes will sort out uniqueness independently of how random the input is.

      The only problem you'll run into is that things like System_Config would be split into two (unlike what you seem to want according to your sample), even if you stop splitting after 4 underscores (which is the minimum depth required for getting a separate L2 entry). So you'd have to invent some additional logic to determine how deep to split...

        The logic would be in the displayer. If the hash has one element, join with the parent with an underscore. It works in all the OP's cases.