![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NAWK Script not working fine | dheeraj19584 | Shell Programming and Scripting | 3 | 06-12-2008 08:36 AM |
| how to access values of awk/nawk variables outside the awk/nawk block? | saniya | Shell Programming and Scripting | 5 | 05-13-2008 08:37 AM |
| nawk/ksh help | DeltaX | Shell Programming and Scripting | 0 | 03-06-2008 03:54 PM |
| nawk use | ctap | UNIX for Advanced & Expert Users | 2 | 01-17-2008 06:45 AM |
| help with Awk or nawk | Gerry405 | UNIX for Dummies Questions & Answers | 2 | 11-28-2005 01:00 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Dear experts
I have a big file containing several profiles each flagged with "PROFILE" at the beginning of each one. I am trying to use the following command in cshell to seperate each profile and save each one in seperate file. I wrote a script as following: nawk -v i=0 '{if($1~/PROFILE/) i=i+1, print $0 }' filename > filename$i I was expecting that it will create different files like file1, file2, ... for each profile but it is not the case. It may need to introduce variable i somehow to shell environment but how can I manage " i " in nawk command can be recognized in shell environment. Thanks in advances for your advises. Reza |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|