Skip to content

Instantly share code, notes, and snippets.

View paulgambill's full-sized avatar

Paul Gambill paulgambill

View GitHub Profile
paulgambill / gist:7146202
Created October 24, 2013 22:24
This Ruby script parses the dataset from to find the top name for each sex/year/state permutation. The result is a .csv with a row for each year/sex/top name combination. Be sure to replace the path on line 7 with your local path.
require 'csv'
year = 1910"stateNamesParsed.csv", "ab") do |csv|
Dir.glob('PATH/*.TXT') do |file|
next if file == '.' or file == '..' do |line|
array = line.split(',')
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();