Skip to content

Instantly share code, notes, and snippets.

@zerokarmaleft
Created December 4, 2012 21:43
Show Gist options
  • Save zerokarmaleft/4209069 to your computer and use it in GitHub Desktop.
Save zerokarmaleft/4209069 to your computer and use it in GitHub Desktop.
in `delete': invalid byte sequence in UTF-8 (ArgumentError)
# encoding: utf-8
merged_file = File.open("rfc-all.txt", "w")
Dir.entries(".").each do |file|
if (file != "rfc-all.txt" and File.extname(file) == ".txt")
merged_file.print "#{ file }\t"
File.open(file).each do |line|
merged_file.print line.chomp.delete "\t"
end
merged_file.print "\n"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment