Skip to content

Instantly share code, notes, and snippets.

@joannecheng
Last active May 19, 2016 11:35
Show Gist options
  • Save joannecheng/6887910 to your computer and use it in GitHub Desktop.
Save joannecheng/6887910 to your computer and use it in GitHub Desktop.
require 'csv'
rows = CSV.read("Medicare_Provider_Charge_Inpatient_DRG100_FY2011.csv")[1..-1]
column_names = %w(drg_definition provider_name state average_total_payments_to_provider)
puts column_names.to_csv
rows.each do |row|
puts [row[0], row[2], row[5], row[-1]].to_csv
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment