![]() |
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 |
| Translating gcc/g++/gfortran Options to Sun Studio Compiler Options | iBot | Solaris BigAdmin RSS | 0 | 02-04-2009 02:30 PM |
| no options | nascimento.rp | AIX | 2 | 08-20-2006 02:46 PM |
| options | terms5 | UNIX for Dummies Questions & Answers | 1 | 01-27-2006 01:50 AM |
| options with awk | mips | Shell Programming and Scripting | 2 | 05-15-2004 03:33 AM |
| cp options | milage | UNIX for Dummies Questions & Answers | 3 | 07-13-2001 12:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Sed options
I have a file with name input_file.spec.
This file has records like: Record #: 1 rec_len = 590 rec_id = 31229 filler_4 = " " orig_id = 902162988 seqnum = 138960799 lrnid = "0" l_ind = "0" transaction_cnt = 1 cust_id = 61032336 product_id = 135488621 ans so on. It has 1000 records in this file. I have to give new numbering to seqnum field only. i am gogin to start with 1 and ll end with 1000. I worte this: #!/bin/ksh i=1 echo "Give input file" INPUTFILES=input_file.spec cat $INPUTFILES | while read LINE do let i=i+1 sed -e '/seqnum/s/seqnum = [0-9]*/seqnum = '$i'/g' $LINE done but the "i" is not getting interpolated event when its reading line by line. Can u please tell any option in unix to do the same. or alternative to do the same business. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|