Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How to reorder a text file

by Cristoforo (Curate)
on Jun 11, 2018 at 23:43 UTC ( #1216446=note: print w/replies, xml ) Need Help??


in reply to How to reorder a text file

Taken from Re: Split and print hash based on regex
#!/usr/bin/perl use strict; use warnings; open my $fh, '<', \<<EOF; Title 1 Line of text A Line of text B Title 2 Line of text C Title 3 Title 4 Line of text D EOF { local $/; print reverse <$fh> =~ /(^Title(?:(?!^Title).)*)/msg; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1216446]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2020-09-20 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (120 votes). Check out past polls.

    Notices?