This file contains hidden or 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 'google_custom_search_api' | |
require 'json' | |
require 'csv' | |
# Enter's API key and Custom Search Engine identifier | |
GOOGLE_API_KEY = 'ENTER_GOOGLE_API_KEY' | |
GOOGLE_SEARCH_CX = 'ENTER_CSE_IDENTIFIER' | |
read_file = 'LOCATION_OF_CSV_WITH_COMPANY_NAMES' | |
write_file = 'LOCATION_OF_OUTPUT_CSV' |
This file contains hidden or 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' | |
# Set the output file | |
write_file = '/../summary.csv' | |
Dir.foreach("/Users/../") do |file| | |
next if file == '.' or file == '..' | |
rows = File.foreach("/Users/../#{file}").count | |
puts "#{file} has #{rows} rows" |