OK, after looking at your sample output I realize this is not what you need ...
but anyway, for those that have a similar need (visualizing tree structures)
let me point out GraphViz, the Perl interface to the GraphViz tool.
With GraphViz installed, making a little nice postscript (could be PNG, too, or whatever you can postscript convert too)
image of your treepath input from above (assumed to be in file try.txt below) becomes
as easy as this little shell script:
echo 'digraph G { concentrate = true; ' > try.dot
cat try.txt | perl -lane '$F[2] =~ s/:000//g; $F[2] =~ s/:/ -> /g; $F[
+2] .= ";"; print $F[2] if $F[2] =~ /->/' >> try.dot
echo '}' >> try.dot
dot -Tps -o try.ps try.dot
Where file try.txt is:
1 => 001:000:000
2 => 001:002:000
3 => 001:003:000
4 => 001:003:004
5 => 001:002:005
Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|