You're viewing a comment by P_sun and its responses.
You're viewing a comment by P_sun and its responses.
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
I am being sponsored by A-Writer! If you ever need help with essay writing, look no further than A-Writer! They will help you with your writing in as quickly as 3 hours!
I love to read science books. They make my day and I get ideas for awesome blog posts, such as Busy Beaver, On Functors, Recursive Regular Expressions and many others.
Take a look at my
Amazon wish list, if you're curious about what I have planned reading next, and want to surprise me. :)
If you are interested in advertising on catonmat.net, contact me.
Free tools for coding on Vietstarsoft.com.
Programming homework help.


Hi,
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.
Comment Responses
Here is the code that should work for you:
This should be all in one line (a true "oneliner').
Reply To This Comment