Sunday, February 25, 2007

Replacing numbers in text files

Recently I've encountered a very annoying problem - I have a text file which consists of the following "1. Text & Numbers 2. Text & Numbers 3. Text&Numbers...", etc. up to 60. Now since I want to add some more things in the beginning I have to renumber the rest of the list accordingly. Say I want to add seven items, then the numbers followed by dots should revert to the number seven+current number. Well, it turns out I could not find any simple way of doing this. A colleague referred to Emacs, so I will spend the next few days (whenever time is available) in learning the basic commands, but at first sight I couldn't spot something useful.
If I am unable to find other solutions, I guess I will just have to write a simple program in java or C to deal with the nuisance.
Now back to work.