Writing proper host entries to text file after pulling from remote mysql database.