You're viewing a comment by manish and its responses.

manish Permalink
January 05, 2009, 12:04

Hi All, i have a query....i want to search a refrence number in a given file (say ref num ABC123) and then copy the next 20 line after the reference number and exit....please help me how to do the same....thnx in advance

Comment Responses

Anirudh Permalink
February 02, 2016, 11:50
sed -e '
   /\n/q
   /ABC123/!d
   :loop
      $q; N
      s/\n/&/20; tdone
   bloop
   :done
   D
' yourfile

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "cloud_95": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.