You're replying to a comment by P_sun.

P_sun Permalink
March 23, 2011, 18:32

If I want to get the lines 506, 590 and 600 (from text1.log) written to out.log.
The following command allows me to do that:

awk 'NR==506||NR==590 || NR==600' "text1.log" > out.txt

Let us set a=506, b=590 and c=600.
Now what I need is lines 628 (a+(122)*n), 712 (b+(122)*n),
722 (c+(122)*n) ,where n=1-20 written out from text1.log.
Can awk be suitable for this?
Can someone outline how this can be done. I appreciate your help.

If the above needs to be repeated for a series of outputs, text2.log, text3.log, how can this be done? Any help is greatly appreciated.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

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

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