Skip to content

Instantly share code, notes, and snippets.

@lodestone
Created November 25, 2013 06:40
Show Gist options
  • Save lodestone/7637228 to your computer and use it in GitHub Desktop.
Save lodestone/7637228 to your computer and use it in GitHub Desktop.
arr = []
File.open(file, 'r').each_line do |line|
line = line.split(';')
line.reverse!
arr << {word: line.pop, public: line.pop, vulgar: line.pop, pos: line.pop, definition: line.pop}
end
arr.in_groups_of(1000) {|g| r.table("entries").insert(g).run }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment