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