![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NAWK Script not working fine | dheeraj19584 | Shell Programming and Scripting | 3 | 06-12-2008 04:36 AM |
| how to access values of awk/nawk variables outside the awk/nawk block? | saniya | Shell Programming and Scripting | 5 | 05-13-2008 04:37 AM |
| nawk/ksh help | DeltaX | Shell Programming and Scripting | 0 | 03-06-2008 11:54 AM |
| nawk use | ctap | UNIX for Advanced & Expert Users | 2 | 01-17-2008 02:45 AM |
| help with Awk or nawk | Gerry405 | UNIX for Dummies Questions & Answers | 2 | 11-28-2005 09:00 AM |
|
|
LinkBack | Thread Tools | 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 |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
|
|
||||
|
for AWking/SEDing you can look into:
http://www.cs.uu.nl/docs/vakken/st/nawk/nawk_toc.html http://www.faqs.org/faqs/computer-lang/awk/faq/ http://www-personal.umich.edu/~jlawl...edawkperl.html http://www.cs.uu.nl/~piet/docs/nawk/ http://www.ptug.org/sed/sedfaq.htm http://main.rtfiber.com.tw/~changyj/sed/ http://kornshell.com/ http://cfaj.freeshell.org/shell/ http://steve-parker.org/sh/sh.shtml There are others, but these should keep you busy for awhile |
|
|||
|
could you please tell me how to convert a horizontal line into a vertical line using UNIX.
I have 07:37:37 07:31:29 07:21:18 07:08:55 07:08:30 07:00:34 06:53:40 this in a file . Help me in getting it into below format. 07:37:37 07:31:29 07:21:18 07:08:55 07:08:30 07:00:34 06:53:40 |
|
|||
|
Code:
tr ' ' ' ' <file Edit: didn't notice you were hijacking somebody else's thread. Please don't do that. |
|||
| Google UNIX.COM |