| Raw Input
|
| Desired Output
| Line -9
Line -8
Line -7
Line -6
Line -5
Line -4
Line -3
Line -2
Line -1
|
| Line -6
Line -5
Line -4
Line -3
Line -2
Line -1
|
|
Description
The following scripts use the Pattern Space (abbreviated to `PS' later)
to implement a `sliding windows':
- The first 6 lines of a file will fill that window.
- Then we slide it by deleting the first line and joining
the next line of the input file to the end of it.
This procedure repeats until the last line of the file is reached.
|
Script and Comments
Script1 [ 1] :loop
[ 2] $q
[ 3] /^\([^\n]*\n\)\{5\}/D
[ 4] N
[ 5] b loop
| |
Script2 [ 1] :loop
[ 2] N
[ 3] /^\([^\n]*\n\)\{5\}/!b loop
[ 4] $!D
| |
|