Article 5ARZG send output to specific line

send output to specific line

by
Pinguino99
from LinuxQuestions.org on (#5ARZG)
good everning, I'm using the command sed -n '/PATTERN1/,/PATTERN2/p' file
to get the text between the patterns, however, I wanted to send the output to a specific line, is it possible?

ex:

file
Code:PATTERN1
A -1
B - 2
C - 3
PATTERN2file2 with result
Code:FOO
BOO
NNN
PATTERN1
A -1
B - 2
C - 3
PATTERN2
MOO
NUU
POPin the result the output was sent to the line below that contained the text NNN

Thank you to everyone, have a good nightlatest?d=yIl2AUoC8zA latest?i=peBCy9i1t9g:Fn-S2k--pr8:F7zBnMy latest?i=peBCy9i1t9g:Fn-S2k--pr8:V_sGLiP latest?d=qj6IDK7rITs latest?i=peBCy9i1t9g:Fn-S2k--pr8:gIN9vFwpeBCy9i1t9g
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments