Skip to content

Instantly share code, notes, and snippets.

@Andrzej
Created October 26, 2011 22:02
Show Gist options
  • Save Andrzej/1318027 to your computer and use it in GitHub Desktop.
Save Andrzej/1318027 to your computer and use it in GitHub Desktop.
Sort file by regex
r=/".+"/; puts File.readlines("file.txt").sort{|a,b| a[r] <=> b[r]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment