Created
February 26, 2015 23:35
-
-
Save JasonMadeSomething/7d57610194c18d8f05a8 to your computer and use it in GitHub Desktop.
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
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