Skip to content

Instantly share code, notes, and snippets.

@workmad3
Created December 4, 2012 17:04
Show Gist options
  • Save workmad3/4206268 to your computer and use it in GitHub Desktop.
Save workmad3/4206268 to your computer and use it in GitHub Desktop.
Replace " with '
def replacer(filename, find = ?", replace = ?')
File.open(filename, "r+") do |file|
file.each do |line|
file.seek(-line.bytes.to_a.size, IO::SEEK_CUR)
file.write line.gsub(find, replace)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment