in reply to reparse tree in textfile
Thanks for your efforts ikegami (Apostle) and repellent (Chaplain)
Awesome!!
worked on 70,000 line backup text file
I used
my @path = '.';
while (<STDIN>) {
chomp;
my ($prefix, $node) = /^((?:\| )*`-- )(.+)/
or next;
$#path = length($prefix)/2 - 1;
$path-1 = $node;
# print $prefix, join("/" => @path), "\n";
print join("/" => @path), "\n";
}
ikegami yes, I didn't want prefix printed
|
---|
In Section
Seekers of Perl Wisdom