I tried to do +> but it seems to empty the file. About $val+1, according to the program logic the digit there will always be single digit, so there is no problem of additional bit. So the only problem now, is to open the file and grep a key and then replace the 2nd field.
So anything else I can do now...?