Skip to content

Instantly share code, notes, and snippets.

@SamSamskies
Last active December 16, 2015 05:08
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 SamSamskies/5381839 to your computer and use it in GitHub Desktop.
Save SamSamskies/5381839 to your computer and use it in GitHub Desktop.
I created a ruby one liner to delete all blank lines from a text file and store each line in an array.
#returns an array filled with each non-blank line from the file as elements.
File.read(file).squeeze("\n").split("\n")
@mikelikesbikes
Copy link

NICE!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment