This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'httparty' | |
require 'json' | |
header = File.open('input.tsv', &:readline) # get header from input file | |
header = header.to_s.gsub("\n","") # remove newline characters | |
header << "\t\t\tlatitude\t\t\tlongitude\n" # format header | |
File.open("output.tsv", 'w') {|file| file.write(header) } # create output file and append header | |
base_url = "http://maps.googleapis.com/maps/api/geocode/json?address=" |
NewerOlder