Attached to this post is an .exe that has been .rared.
When you start it it will open up a console window, and wait for your input.
You will need to insert two numbers, the first one will be the number of lands you need to #setland on (so if you want lands 1-241, you will type in 241), the second number will determine the poptype that will be set for all. (In this case I guess you'll want 100)
The program will create a file called IO.txt that will contain the lines you want.
(I see that you already found a better way of doing it, but since it only took a few seconds to code, I did it anyway
)
No spaces in the .map file sounds like it could cause problems, if #land 3 is turned to #land3 maybe it can give the game problems? (I never actually made a map, so I know nothing about those things)