![]() |
|
|
|
|
|||||||
| 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 |
| Multiple field separators in awk? (First a space, then a colon) | doubleminus | UNIX for Dummies Questions & Answers | 3 | 04-27-2008 12:28 PM |
| Multiple input field Separators in awk. | kinksville | Shell Programming and Scripting | 4 | 04-25-2008 02:12 PM |
| using nawk to concate the fields | raychu65 | UNIX for Dummies Questions & Answers | 2 | 01-25-2008 01:26 AM |
| Append tabs at the end of each line in NAWK -- varying fields | madhunk | Shell Programming and Scripting | 6 | 07-12-2006 03:20 PM |
| Awk Multiple Field Separators | Tonka52 | Shell Programming and Scripting | 7 | 04-07-2004 06:37 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I need help counting the fields and field separators using Nawk
I need help counting the fields and field separators using Nawk.
I have a file that has multiple lines on it and I need to read the file 1 at a time and then count the fields and field separators and then store those numbers in variables. I then need to delete the first 5 fields and the blank spaces. example: 45 21 * * * run_cron /temp "daily_files.ksh" I want to read the file that has this line and then write it to a new file with a line that looks like this: run_cron /temp "daily_files.ksh" The problem is that the the first 5 fields (which is what I really want to get rid of) are not the same for each line I am reading. Any help is much appreciated. Thanks Last edited by scrappycc; 02-05-2008 at 04:47 PM. |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
Also, awk is specifically designed to process structured data so it understands fields. using awk might be more "appropriate" in OP's case. |
|||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|