Description
In the following example, we want to prepend the contents of 'file2'
before every line of 'file1' that ends with 2,3 or 5.
|
| Raw Input
|
| Desired Output
| file1:
line 1
line 2
line 3
line 4
line 5
file2:
sample A
sample B
|
| line 1
sample A
sample B
line 2
sample A
sample B
line 3
line 4
sample A
sample B
line 5
|
|
Script and Comments
Script1 [ 1] 1!{
[ 2] x
[ 3] p
[ 4] x
[ 5] }
[ 6] h
[ 7] /[235]$/r file2
[ 8] d
| |
|