![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| simple while loop | ali560045 | Shell Programming and Scripting | 10 | 12-26-2007 10:44 AM |
| simple for loop | ali560045 | Shell Programming and Scripting | 3 | 12-17-2007 01:39 AM |
| Simple loop query | kutz13 | UNIX for Dummies Questions & Answers | 2 | 07-17-2007 04:13 PM |
| Simple while loop question | Brokeback | Shell Programming and Scripting | 3 | 07-21-2006 10:04 AM |
| a simple while loop | syno | Shell Programming and Scripting | 5 | 04-08-2006 07:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
a simple loop in csh
Hello,
I have a file with over 48000 lines and I need to select certain parts of the file. I know which awk commands work for what I need, I just need some help putting together a loop that will repeat the command. These are the commands that work: awk 'NR < 6' plot.out > plot.test (I get the first 5 lines of plot.out) awk 'NR==15,NR==17' plot.out >> plot.test (now I need these lines) awk 'NR==30,NR==32' plot.out >> plot.test (etc.) awk 'NR==45,NR==47' plot.out >> plot.test awk 'NR==60,NR==62' plot.out >> plot.test awk 'NR==75,NR==77' plot.out >> plot.test awk 'NR==90,NR==92' plot.out >> plot.test awk 'NR==105,NR==107' plot.out >> plot.test awk 'NR==120,NR==122' plot.out >> plot.test awk 'NR==135,NR==137' plot.out >> plot.test Please help. All the loops I make don't work I know this is simple for somebody out there..... |
|
||||
|
Quote:
I see that NR is incremented by 15 cat plot.out|awk -v x=15 'NR==x,NR==x+2 {x=x+15};END{print $0}' |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|