Some friends recently needed a hand converting a large set of addresses into map coordinates, so I pulled together some code I was using in other projects into a small script. It uses Yahoo's Geoplanet API since I've found that gives good results with a lot fewer restrictions than Google's geocoder. Since it seemed like this might be handy for other people too, I've put the code up on github at http://github.com/petewarden/geocodefile
To use it, get a free app ID from Yahoo and then run
./geocodefile.php -i testdata.txt -o output.txt -s
After a few seconds it should complete, and the output should contain estimated latitude,longitude coordinates for all the locations in the test data.