my @path; while (<DATA>) { chomp(); /^((?:\| )*[|`]-- )(.+)/ or next; $#path = length($1)/2 - 3; # truncate path based on tree level push(@path, $2); print $1, "./", join("/" => @path), "\n"; }
In reply to Re: reparse tree in textfile
by repellent
in thread reparse tree in textfile
by myuserid7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |