Skip to content

Instantly share code, notes, and snippets.

@mweppler
Created January 16, 2012 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mweppler/1622522 to your computer and use it in GitHub Desktop.
Save mweppler/1622522 to your computer and use it in GitHub Desktop.
Remove newlines from files
out_file = File.new("/Users/username/column_names-new.csv", "w")
File.open("/Users/username/column_names.csv", "r") do |in_file|
while line = in_file.gets
out_file.write line.tr("\n","")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment