Skip to content

Instantly share code, notes, and snippets.

@tbuehlmann
Created February 20, 2018 09:52
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 tbuehlmann/4395e2c94d7b83348f035124a7269017 to your computer and use it in GitHub Desktop.
Save tbuehlmann/4395e2c94d7b83348f035124a7269017 to your computer and use it in GitHub Desktop.
1
2
3
4
5
6
7
8
9
10
File.read('file.txt').split("\n\n").map { |group| group.split("\n") }
# => [["1", "2"], ["3", "4"], ["5", "6", "7"], ["8", "9"], ["10"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment