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 night


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 night