• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

Find string in file

Hello experts,
Please help me to find solution for the following problem:
In file I need to find string "PORT" between Some 2 other strings. For exmple between "START_BLOCK_1:" and "END_BLOCK" and after that
between "START_BLOCK_2:" and "END_BLOCK"

START_BLOCK_1:
aaa
bbb
PORT=
ccc
ddd
END_BLOCK
START_BLOCK_2:
eee
fff
PORT=
hhh
jjj
END_BLOCK

Thanks




 
0
IKeystone
Asked:
IKeystone
1 Solution
 
jazzIIIloveCommented:
0
 
ozoCommented:
perl -ne 'print if (/START_BLOCK/../END_BLOCK/) && /PORT/'
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now