Let's say I have a text file that has svn list output like so:
testing123/ foobar/ helloworld/ helloworld/r1/ helloworld/r1/helloworld-5-0.noarch.rpm helloworld/r1/testfile23.txt helloworld/r1/tomcat-7.0.27.rpm helloworld/r2/ helloworld/r2/helloworld-2-0.noarch.rpm helloworld/r2/testfile12.txt helloworld/r2/tomcat-5.0.52.rpm hellotest/
The file can be of any length. I basically want to identify the terminal directories in the tree. In the above example, I am looking to isolate:
testing123/ foobar/ helloworld/r1/ helloworld/r2/ hellotest/
Any tips? I was thinking about reading the file into a hash or something, and then iterate the hash. I suspect I might need something like recursion. But recursion is my achilles heal. Never can grok it properly.
Any help would be much appreciated. Thanks.
In reply to Finding deepest directories in a tree structure represented in a flatfile? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |