![]() |
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 |
| find and replace using sed | arvind_aks15 | Shell Programming and Scripting | 2 | 07-18-2008 05:26 PM |
| Find and Replace | NycUnxer | UNIX for Dummies Questions & Answers | 4 | 03-06-2008 12:20 AM |
| find replace | dbsurf | Shell Programming and Scripting | 2 | 01-25-2008 08:39 AM |
| find and replace | valhutch | UNIX for Dummies Questions & Answers | 4 | 07-29-2006 05:20 PM |
| Find & Replace | gagansharma | Shell Programming and Scripting | 3 | 11-27-2001 04:17 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
awk find/replace
Greetings all.
I have web site that has long option and switch lists. When I insert something new into these files, the lists need to be reordered. IE: 1 => apple 2 => pear 3 => bannana 4 => orange --------------------- Add grape as #2 1 => apple 2 => grape 3 => pear 4 => bannana 5 => orange In this example it is easy to reorder. However my files have close to 200 entries. Making the reordering very tedious and labor intensive. What I am wondering, is it possible to use awk find/replace along with C to automate this process? The idea would be to construct a while loop, find the next number to replace and replace it with the next higher number. Loop through the process until finished. Does that sound like the easiest solution or is there something easier/better out there? Thank you for your thoughts. ~Robert |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|