Sometimes, you have to take the whole picture into account. In this case, it seems like you are doing all of your work in flat files, but you will probably have to upload your final results back into the database, which itself takes time. Which will be faster? Who knows. Also, how often will have to standardize this data? If you're only doing it once, your code is throw away and it could be argued that time spent optimizing could be time better spent. If you're not only doing it once, the larger question that begs to be asked is: why? If you don't have control over how the records are inserted into the db, fair enough. However, if you do, you should place a filter on the front end to keep your records in canonical form by doing these substitutions
before they are even inserted into the db. This keeps you from having to iterate over the entire database, most of which you have already "fixed".
thor