Description
- The first line of a block begins with `#' followed by a space and a tag,
which implies the end of the preceding block.
|
| Raw Input
|
| Desired Output
| #100
ADD some/file/path
MODIFY diff/file/path
#104
MODIFY /another/modified/file/path
DEL /a/deleted/file/path
MODIFY /one/more/file/path
|
| 100 ADD some/file/path
100 MODIFY diff/file/path
104 MODIFY /another/modified/file/path
104 DEL /a/deleted/file/path
104 MODIFY /one/more/file/path
|
|
Script and Comments
Script1 [ 1] /^# /{
[ 2] h
[ 3] d
[ 4] }
[ 5] G
[ 6] s/^(.*)\n# (.*)/\2 \1/
| |
|