I want to grep every block of lines that has starting line with "CK \" at the end of line and ending line that has "D \" at the end of line, I can use sed/awk/grep etc.

So far i have tried following with no luck:

$ sed -e '/CK \\$/,/D \\$/' file | more   

Here is the example of one of the blocks.

 pcs_dual_logic/e3bis_chbist_jj/e3bis_ch_ptn_gen_cur_st_reg_1_/CK \
  pcs_dual_logic/e3bis_chbist_jj/e3bis_ch_ptn_gen_cur_st_reg_1_/Q \
  pcs_dual_logic/e3bis_chbist_jj/U341/X \
  pcs_dual_logic/e3bis_chbist_jj/U331/X \
  pcs_dual_logic/e3bis_chbist_jj/U70/X \
  pcs_dual_logic/e3bis_chbist_jj/U487/X \
 pcs_dual_logic/est_jje3bis_ch_ptn_gen_e3bis_random_data_gen_random_data_reg_6_/D \
sed '/CK \\$/,/D \\$/!d' file | more

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.