![]() |
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 |
| Changing one column of delimited file column to fixed width column | manneni prakash | Shell Programming and Scripting | 5 | 06-22-2009 05:27 AM |
| Increment ABC-123 by 1!! | pgmfourms | Shell Programming and Scripting | 4 | 05-29-2009 01:14 AM |
| Increment value (starttime) | Amit.Sagpariya | Shell Programming and Scripting | 2 | 10-27-2008 06:01 AM |
| increment an integer | melanie_pfefer | Shell Programming and Scripting | 4 | 10-01-2008 11:52 AM |
| How to Increment or add minutes???;-) | prashant43 | Shell Programming and Scripting | 14 | 08-19-2008 09:48 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Increment a column using awk
Hi,
I have a sample file like below: 213~!0~!Feb 16 2009 4:57:29:833PM~!0 212~!0~!Feb 7 2009 5:29:57:760PM~!0 211~!0~!Feb 4 2009 5:51:40:863PM~!0 209~!0~!Dec 17 2008 3:19:05:043PM~!0 206~!0~!Dec 4 2007 4:01:02:850PM~!0 "~!" is the field seperator. I need to replace the first row, first column of the file with a variable passed to it and then increment the first column of the subsequent rows by 1. For eg, the variable is 500. the output should be. 500~!0~!Feb 16 2009 4:57:29:833PM~!0 501~!0~!Feb 7 2009 5:29:57:760PM~!0 502~!0~!Feb 4 2009 5:51:40:863PM~!0 503~!0~!Dec 17 2008 3:19:05:043PM~!0 504~!0~!Dec 4 2007 4:01:02:850PM~!0 Any help on this is much appreciated. Thanks Hemant |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|