hennesse has asked for the wisdom of the Perl Monks concerning the following question:
I have a 15,000 line text file where I want to "reverse" groups of lines. In the example below, a group is a Title followed by 0 or more lines of text. What is an efficient approach to do this?
Input file:Desired Output:Title 1 Line of text A Line of text B Title 2 Line of text C Title 3 Title 4 Line of text D
Thanks, DaveTitle 4 Line of text D Title 3 Line of text D Title 3 Title 2 Line of text C Title 1 Line of text A Line of text B
Back to
Seekers of Perl Wisdom