def parse_file(src, dest)
      create_table(dest)

      puts "***** Importing #{dest}"

      count = 0
#      names = File.foreach(src).collect do |line|
      names = open(src).collect do |line|        
        count += 1
        if count % 2000 == 0
          puts count
        end

        data = line.split

        name = data.first.capitalize
        freq = data[2].to_f

        name = if dest == "surname"
                 cleanup_surname(name)
               else
                 cleanup_firstname(name)
               end

        {:name => name, :freq => freq}
      end

      puts "loading into db"

      # remove any existing records
      @db[dest.to_sym].truncate

      # insert!
      @db[dest.to_sym].multi_insert(names)
    end
def parse_file(src, dest)
      create_table(dest)

      puts "***** Importing #{dest}"

      count = 0
#      names = File.foreach(src).collect do |line|
      names = open(src).collect do |line|        
        count += 1
        if count % 2000 == 0
          puts count
        end

        data = line.split

        name = data.first.capitalize
        freq = data[2].to_f

        name = if dest == "surname"
                 cleanup_surname(name)
               else
                 cleanup_firstname(name)
               end

        {:name => name, :freq => freq}
      end

      puts "loading into db"

      # remove any existing records
      @db[dest.to_sym].truncate

      # insert!
      @db[dest.to_sym].multi_insert(names)
    end
parse a census file.  it will have the format:
    name           freq   cumulative rank
    MARY           2.629  2.629      1
    PATRICIA       1.073  3.702      2
    LINDA          1.035  4.736      3

 we only need the name and the frequency, parse those out and
 insert into specified table

 src - which file to parse
 dest - which table to load into