It is late here and I was just skimming the forums before calling it a night so excuse me for not taking more time to explain the following code. If you are familiar with programming then it shouldn't take to much to convert it to your language of choice. Just replace the map name with your own and replace "212" with the province number that you are removing.
Hope this helps.
Here is a yabasic script that I wrote to fix an existing map file (AomOrc3.map) when I found a bogus pixel in the map image after all of the neighbor work was already done:
Code:
REM used to fix map file after removing province pixel # 212.
OPEN 1, "AomOrc3.map", "r"
OPEN 2, "AomOrc301fixed.map", "w"
while(not eof(1))
x=0
y=0
line input #1 a$
if left$(a$,8)="#terrain" then
x=val(mid$(a$,10,(instr(a$," ",10)-10)))
xx=val(right$(a$,(len(a$)-instr(a$," ",10))))
if x>212 then
x=x-1
a$="#terrain "+str$(x)+" "+str$(xx)
endif
elseif left$(a$,10)="#neighbour" then
i=11
j=instr(a$," ",12)
x=val(mid$(a$,12,j-i-1))
xx=val(mid$(a$,j+1))
if x>212 then
x=x-1
a$="#neighbour "+str$(x)+" "+str$(xx)
endif
if xx>212 then
xx=xx-1
a$="#neighbour "+str$(x)+" "+str$(xx)
endif
elseif left$(a$,6)="#start" then
x=val(mid$(a$,8))
if x>212 then
x=x-1
a$="#start "+str$(x)
endif
elseif left$(a$,9)="#landname" then
x=val(mid$(a$,11,(instr(a$," ",11)-11)))
tmpstr$=mid$(a$,(instr(a$," ",11)+1))
if x>212 then
x=x-1
a$="#landname "+str$(x)+" "+tmpstr$
endif
endif
print #2 a$
end while
CLOSE #1
close #2