Have Perl script move a line up in block/group of lines
by BudiKusasi from LinuxQuestions.org on (#5QW0X)
How can a Perl (preferably one-liner) script move a line up in a block/group of lines in file (# be a comment token):
Code:*****
*FOO=
BAR
BAZ
*FOOBAR
**** # Token such above to start over again repeatedly...
to be:
*****
*FOOBAR
*FOO=
BAR
BAZ
***** # Token such above to start over again repeatedly...Have the script to be simplest/minimal as long as it is working correctly
Code:*****
*FOO=
BAR
BAZ
*FOOBAR
**** # Token such above to start over again repeatedly...
to be:
*****
*FOOBAR
*FOO=
BAR
BAZ
***** # Token such above to start over again repeatedly...Have the script to be simplest/minimal as long as it is working correctly