in reply to Re^2: break-down ranges
in thread break-down ranges

Teaching is free here, and I am happy with that arrangement, because it means learning here is free as well. I don't get a warm fuzzy about doing work for free though.

Read your file in a loop. Chomp inside the loop, then capture into $1 with m/^(\d+)\s{4}/. Save what's in $1 for later. Substitute away that initial stuff so that it doesn't get in the way of your subsequent parsing. Then just prepend what you saved up front per line to the front of your output for that line after parsing the ranges.

Before making your next post make sure to have a look at Writeup Formatting Tips. And please be sure to show us the code you've tried, and where you're stuck in the future. Welcome to the Monastery, a home for Seekers of Perl Wisdom.


Dave

Replies are listed 'Best First'.
Re^4: break-down ranges
by AnomalousMonk (Archbishop) on Jul 04, 2011 at 22:06 UTC

    I wish I could give davido a double ++: first, for linking to the formatting tips (without which the 'specification' of Re^2: break-down ranges looks like mush); second, for gently pointing out that this is SoPW and not SoPPC (Seekers of Perl Production Code). The fact that davido then even went on to give some valuable coding advice in the face of goorgi01's assertion of a lack of time or experience to actually bother with it probably merits yet a third ++.