![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: reparse tree in textfileby myuserid7 (Scribe) |
on Feb 20, 2010 at 23:33 UTC ( #824443=note: print w/replies, xml ) | Need Help?? |
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
|
|