|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | 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. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
delete a field along with delimiter in the whole file
I have file with 20 fields and its pipe delimiter. I need to remove the 18th field along with pipe delimiter that seperates 17th and 18th field. In turn that means i want to make it now a file with only 19 fields. Can some body let me know how ican remove the 18th field from the whole file?
|
| Sponsored Links | ||
|
|
|
|||
|
based on radoulov's code Code:
awk -F \| '{ $17 = $17 FS $19 FS $20; NF=17 }1' OFS="|" t1 |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cutting a tab delimiter file | vinod.thayil | Shell Programming and Scripting | 4 | 11-30-2007 03:38 PM |
| Set a variable field delimiter using awk | Klashxx | Shell Programming and Scripting | 2 | 03-24-2006 09:10 AM |
| splitting file with more than one delimiter | braindrain | Shell Programming and Scripting | 4 | 10-06-2005 09:42 PM |
| How to parse a text file with \034 as field and \035 as end of message delimiter? | indianya | Shell Programming and Scripting | 1 | 08-26-2005 10:20 PM |
| field delimiter with a space or more | uphamtn | UNIX for Dummies Questions & Answers | 3 | 05-15-2003 05:22 PM |