in reply to How to reorder a text file

Title 3 Line of text D Title 3
what?

Replies are listed 'Best First'.
Re^2: How to reorder a text file
by hennesse (Beadle) on Jun 11, 2018 at 22:06 UTC

    Dang - Fried Brain Syndrome. How's this?

    Input file:
    Title 1 Line of text A Line of text B Title 2 Line of text C Title 3 Title 4 Line of text D
    Desired Output:
    Title 4 Line of text D Title 3 Title 2 Line of text C Title 1 Line of text A Line of text B
      $ tac file | perl -ne'push@a,$_;if(/^Title\b/){print reverse@a;@a=()}'