Skip to content

Instantly share code, notes, and snippets.

@JasonMadeSomething
Created February 26, 2015 23:35
Show Gist options
  • Save JasonMadeSomething/7d57610194c18d8f05a8 to your computer and use it in GitHub Desktop.
Save JasonMadeSomething/7d57610194c18d8f05a8 to your computer and use it in GitHub Desktop.
def lawyer?(line_to_check)
#some code to check if line is a lawyer
end
def doctor?(line_to_check)
#some code to check if line is a doctor
end
def create_purged_copy(#somehow pass one of the above (or I suppose any) functions as an argument here...call it some_condition()#,working_path )
File.open(working_path+"/datasample.csv","r") do |source_file|
File.open(working_path+"/dest.csv","w") do |dest_file|
source_file.each_line do |line|
if some_condition(line)
dest_file << line
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment