![]() |
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 |
| Split file based on field | s_adu | Shell Programming and Scripting | 6 | 05-07-2009 02:08 PM |
| How to split a field into two fields? | vbrown | Shell Programming and Scripting | 4 | 02-21-2008 06:50 AM |
| can Awk split my field on the . | oly_r | Shell Programming and Scripting | 6 | 10-26-2007 07:16 PM |
| Need to split a large data file using a Unix script | SAIK | HP-UX | 1 | 03-29-2006 04:05 PM |
| Split a field in awk script | CamTu | Shell Programming and Scripting | 4 | 03-21-2005 04:03 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
awk script to split field data
Hi Experts,
I have a Input.txt document which contains data fields seperated by tabs. There are 4 fields totally Named UNIQUE, ORDER, CONTACT and WINS. The UNIQUE field contains unique ID and the CONTACT field contains data seperated by comma in some records. I am looking to write an awk script which will split the CONTACT field values by comma and produce an output file with the split data and Unique ID as shown in the attachement. Any help is appreciated very much. Many Thanks. Input.txt Code:
########################################### UNIQUE ORDER CONTACT WINS G001 R01 SP,SD solution G002 R01A B,DR,P G003 R02 AF fix G004 R03 PO,AC build ########################################### Code:
########################################### UNIQUE CONTACT G001 SP G001 SD G002 B G002 DR G002 P G003 AF G004 PO G004 AC ########################################### Last edited by zaxxon; 07-21-2009 at 11:10 AM.. Reason: printed attachment into post - easier to read |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|